Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2009 05:27:09 +0000 (UTC)
From:      Qing Li <qingli@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192085 - head/sys/netinet
Message-ID:  <200905140527.n4E5R9Lj078250@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: qingli
Date: Thu May 14 05:27:09 2009
New Revision: 192085
URL: http://svn.freebsd.org/changeset/base/192085

Log:
  Ignore the INADDR_ANY address inserted/deleted by DHCP when installing a loopback route
  to the interface address.

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c	Thu May 14 03:54:03 2009	(r192084)
+++ head/sys/netinet/in.c	Thu May 14 05:27:09 2009	(r192085)
@@ -906,6 +906,9 @@ in_ifinit(struct ifnet *ifp, struct in_i
 	if ((error = in_addprefix(ia, flags)) != 0)
 		return (error);
 
+	if (ia->ia_addr.sin_addr.s_addr == INADDR_ANY)
+		return (0);
+
 	/*
 	 * add a loopback route to self
 	 */
@@ -1014,7 +1017,8 @@ in_scrubprefix(struct in_ifaddr *target)
 	if ((target->ia_flags & IFA_ROUTE) == 0)
 		return (0);
 
-	if (!(target->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) {
+	if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) &&
+	    !(target->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT))) {
 		bzero(&null_sdl, sizeof(null_sdl));
 		null_sdl.sdl_len = sizeof(null_sdl);
 		null_sdl.sdl_family = AF_LINK;



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