svn commit: r338341 - head/sys/netinet6

Andrew Gallatin gallatin at FreeBSD.org
Mon Aug 27 18:13:22 UTC 2018


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(


More information about the svn-src-all mailing list