Skip to content

Commit

Permalink
make sure we do not transmit scope_id extension to the wire, even if
Browse files Browse the repository at this point in the history
we are using 2553bis-01 getaddrinfo (fill scope_id by 0).
sync with netbsd-current
  • Loading branch information
itojun committed Nov 26, 2000
1 parent 7e788db commit 0b0cb6c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions netbsd/usr.bin/ftp/ftp.c
Expand Up @@ -1705,10 +1705,9 @@ initconn(void)
warn("listen");

if (sendport) {
#ifdef INET6
char hname[INET6_ADDRSTRLEN];
char hname[NI_MAXHOST], sname[NI_MAXSERV];
int af;
#endif
union sockunion tmp;

switch (data_addr.su_family) {
case AF_INET:
Expand All @@ -1719,14 +1718,18 @@ initconn(void)
/* FALLTHROUGH */
#ifdef INET6
case AF_INET6:
#endif
af = (data_addr.su_family == AF_INET) ? 1 : 2;
if (getnameinfo((struct sockaddr *)&data_addr,
data_addr.su_len, hname, sizeof(hname),
NULL, 0, NI_NUMERICHOST)) {
tmp = data_addr;
if (tmp.su_family == AF_INET6)
tmp.su_sin6.sin6_scope_id = 0;
if (getnameinfo((struct sockaddr *)&tmp,
tmp.su_len, hname, sizeof(hname), sname,
sizeof(sname), NI_NUMERICHOST | NI_NUMERICSERV)) {
result = ERROR;
} else {
result = command("EPRT |%d|%s|%d|", af, hname,
ntohs(data_addr.su_port));
result = command("EPRT |%d|%s|%s|", af, hname,
sname);
if (!connected)
return (1);
if (result != COMPLETE) {
Expand All @@ -1738,7 +1741,6 @@ initconn(void)
}
}
break;
#endif
default:
result = COMPLETE + 1;
break;
Expand Down

0 comments on commit 0b0cb6c

Please sign in to comment.