Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Aug 2018 18:13:21 +0000 (UTC)
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338341 - head/sys/netinet6
Message-ID:  <201808271813.w7RIDLIt046504@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gallatin
Date: Mon Aug 27 18:13:20 2018
New Revision: 338341
URL: https://svnweb.freebsd.org/changeset/base/338341

Log:
  Reject IPv4 SO_REUSEPORT_LB groups when looking up an IPv6 listening socket
  
  Similar to how the IPv4 code will reject an IPv6 LB group,
  we must ignore IPv4 LB groups when looking up an IPv6
  listening socket.   If this is not done, a port only match
  may return an IPv4 socket, which causes problems (like
  sending IPv6 packets with a hopcount of 0, making them unrouteable).
  
  Thanks to rrs for all the work to diagnose this.
  
  Approved by:	re (rgrimes)
  Sponsored by:	Netflix
  Differential Revision:	https://reviews.freebsd.org/D16899

Modified:
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet6/in6_pcb.c
==============================================================================
--- head/sys/netinet6/in6_pcb.c	Mon Aug 27 15:20:42 2018	(r338340)
+++ head/sys/netinet6/in6_pcb.c	Mon Aug 27 18:13:20 2018	(r338341)
@@ -901,6 +901,10 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo,
 	 * - Load balanced does not contain IPv4 mapped INET6 wild sockets.
 	 */
 	LIST_FOREACH(grp, hdr, il_list) {
+#ifdef INET
+		if (!(grp->il_vflag & INP_IPV6))
+			continue;
+#endif
 		if (grp->il_lport == lport) {
 			idx = 0;
 			int pkt_hash = INP_PCBLBGROUP_PKTHASH(



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808271813.w7RIDLIt046504>