|
|
@@ -13,17 +13,17 @@ char* lc6bootstrap_getip(LC6_BOOTSTRAP *bs) { |
|
|
|
if ( !bs ) |
|
|
|
return NULL; |
|
|
|
|
|
|
|
if ( bs->af == 4 ) { |
|
|
|
if ( bs->ip.af == 4 ) { |
|
|
|
str = malloc(INET_ADDRSTRLEN); |
|
|
|
assert(str); |
|
|
|
memset(str, 0, INET_ADDRSTRLEN); |
|
|
|
inet_ntop(AF_INET, &bs->addr.inet, str, INET_ADDRSTRLEN); |
|
|
|
inet_ntop(AF_INET, &bs->ip.addr.inet, str, INET_ADDRSTRLEN); |
|
|
|
} |
|
|
|
else if ( bs->af == 6 ) { |
|
|
|
else if ( bs->ip.af == 6 ) { |
|
|
|
str = malloc(INET6_ADDRSTRLEN); |
|
|
|
assert(str); |
|
|
|
memset(str, 0, INET6_ADDRSTRLEN); |
|
|
|
inet_ntop(AF_INET6, &bs->addr.inet6, str, INET6_ADDRSTRLEN); |
|
|
|
inet_ntop(AF_INET6, &bs->ip.addr.inet6, str, INET6_ADDRSTRLEN); |
|
|
|
} |
|
|
|
return str; |
|
|
|
} |