In ip6_sprintf no longer use and return one of eight static buffers
for printing/logging ipv6 addresses. The caller now has to hand in a sufficiently large buffer as first argument. This is the "+ one more change" missed in the original commit. Noticed by: tinderbox Pointy hat to: me (#1)
This commit is contained in:
parent
e780f220d8
commit
d1e7a81aa4
@ -3605,10 +3605,12 @@ sctp_print_address(struct sockaddr *sa)
|
|||||||
|
|
||||||
if (sa->sa_family == AF_INET6) {
|
if (sa->sa_family == AF_INET6) {
|
||||||
struct sockaddr_in6 *sin6;
|
struct sockaddr_in6 *sin6;
|
||||||
|
char ip6buf[INET6_ADDRSTRLEN];
|
||||||
|
|
||||||
sin6 = (struct sockaddr_in6 *)sa;
|
sin6 = (struct sockaddr_in6 *)sa;
|
||||||
printf("IPv6 address: %s:%d scope:%u\n",
|
printf("IPv6 address: %s:%d scope:%u\n",
|
||||||
ip6_sprintf(&sin6->sin6_addr), ntohs(sin6->sin6_port),
|
ip6_sprintf(ip6buf, &sin6->sin6_addr),
|
||||||
|
ntohs(sin6->sin6_port),
|
||||||
sin6->sin6_scope_id);
|
sin6->sin6_scope_id);
|
||||||
} else if (sa->sa_family == AF_INET) {
|
} else if (sa->sa_family == AF_INET) {
|
||||||
struct sockaddr_in *sin;
|
struct sockaddr_in *sin;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user