Jeremie Courreges-Anglas wrote:
> Here the code attempts to deal with IPv4-mapped IPv6 addresses,
> something that won't show up on OpenBSD. We don't support them on
> purpose, to avoid surprises and this kind of ugly code.
>
> One could argue that if someone ported the ftpd code to another OS, he
> should make sure that IPv6 sockets can't receive connections from IPv4
> peers (the IPV6_V6ONLY setsockopt). The code below could be a better
> hint, but it's still dead code on OpenBSD.
I debated for a bit whether the second chunk should be used on openbsd, but
since nobody seems to have noticed or cared in some years, i decided to leave
it as i found it. i'm not opposed to switching to the second chunk either.
>
> > -#else
> > - while (fgets(line, sizeof(line), fd) != NULL) {
> > - line[strcspn(line, "\n")] = '\0';
> > - lreply(530, "%s", line);
> > - }
> > - (void) fflush(stdout);
> > - (void) close(fd);
> > - reply(530,
> > - "Connection from IPv4 mapped address is not
> > supported.");
> > - exit(0);
> > -#endif
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
>