svn commit: r215816 - stable/8/sys/netinet

Randall Stewart rrs at FreeBSD.org
Thu Nov 25 12:11:00 UTC 2010


Author: rrs
Date: Thu Nov 25 12:10:59 2010
New Revision: 215816
URL: http://svn.freebsd.org/changeset/base/215816

Log:
  MFC of 215110:
  Fix so that a multicast packet can be sent
  even if there is no route out to that mcast address. The code in
  in_pcb inadvertantly would error (no route) even though
  the user may have specified the address with the
  proper socket option (to specify the egress interface).
  Thanks bz for reminding me I forgot to commit this ;-)

Modified:
  stable/8/sys/netinet/in_pcb.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/in_pcb.c
==============================================================================
--- stable/8/sys/netinet/in_pcb.c	Thu Nov 25 08:55:57 2010	(r215815)
+++ stable/8/sys/netinet/in_pcb.c	Thu Nov 25 12:10:59 2010	(r215816)
@@ -833,10 +833,6 @@ in_pcbconnect_setup(struct inpcb *inp, s
 		}
 	}
 	if (laddr.s_addr == INADDR_ANY) {
-		error = in_pcbladdr(inp, &faddr, &laddr, cred);
-		if (error)
-			return (error);
-
 		/*
 		 * If the destination address is multicast and an outgoing
 		 * interface has been set as a multicast option, use the
@@ -861,9 +857,12 @@ in_pcbconnect_setup(struct inpcb *inp, s
 				laddr = ia->ia_addr.sin_addr;
 				IN_IFADDR_RUNLOCK();
 			}
+		} else {
+			error = in_pcbladdr(inp, &faddr, &laddr, cred);
+			if (error) 
+				return (error);
 		}
 	}
-
 	oinp = in_pcblookup_hash(inp->inp_pcbinfo, faddr, fport, laddr, lport,
 	    0, NULL);
 	if (oinp != NULL) {


More information about the svn-src-stable-8 mailing list