PERFORCE change 157794 for review

Andre Oppermann andre at FreeBSD.org
Mon Feb 16 08:06:55 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=157794

Change 157794 by andre at andre_flirtbox on 2009/02/16 16:06:03

	Do not insert our outgoing interface address when forwarding
	and the source IP is 0.0.0.0.

Affected files ...

.. //depot/projects/tcp_new/netinet/ip_output.c#3 edit

Differences ...

==== //depot/projects/tcp_new/netinet/ip_output.c#3 (text+ko) ====

@@ -362,13 +362,15 @@
 
 	/*
 	 * If the source address is not specified yet, use the address
-	 * of the outoing interface.
+	 * of the outoing interface.  Packet with an unspecified source
+	 * address may be not be forwarded.
 	 */
 	if (ip->ip_src.s_addr == INADDR_ANY) {
-		/* Interface may have no addresses. */
-		if (ia != NULL) {
+		/* XXX: Interface may have no addresses. */
+		if (ia != NULL && !(flags & IP_FORWARDING))
 			ip->ip_src = IA_SIN(ia)->sin_addr;
-		}
+		else
+			goto bad;
 	}
 
 	/*


More information about the p4-projects mailing list