From owner-svn-src-head@FreeBSD.ORG Thu May 14 05:27:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58848106564A; Thu, 14 May 2009 05:27:10 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 463B88FC1F; Thu, 14 May 2009 05:27:10 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4E5R97g078251; Thu, 14 May 2009 05:27:09 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4E5R9Lj078250; Thu, 14 May 2009 05:27:09 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200905140527.n4E5R9Lj078250@svn.freebsd.org> From: Qing Li Date: Thu, 14 May 2009 05:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192085 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2009 05:27:10 -0000 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;