diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2016-10-25 19:40:58 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2016-10-25 19:40:58 +0000 |
commit | 9c72f012324aebc02eb5d12866812c70d316b687 (patch) | |
tree | 3f2596d776df44f81ec6d8967a19c289af224e88 | |
parent | 951e8278923b8f25eba4bd4cfdb877ee65119a91 (diff) |
bluhm@ pointed out that addr->sin6_port should be forced to zero since
a port doesn't make sense for a raw socket.
I forgot to commit this hunk in the previous commit. Sorry about that.
-rw-r--r-- | sys/netinet6/raw_ip6.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index c0a89af00ff..69c96a4f7b3 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.97 2016/10/25 06:26:03 florian Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.98 2016/10/25 19:40:57 florian Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -650,6 +650,12 @@ rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, break; } + /* + * Make sure to not enter in_pcblookup_local(), local ports + * are non-sensical for raw sockets. + */ + addr->sin6_port = 0; + if ((error = in6_pcbaddrisavail(in6p, addr, 0, p))) break; |