svn commit: r224703 - head/sys/net

Kevin Lo kevlo at FreeBSD.org
Mon Aug 8 05:25:52 UTC 2011


Author: kevlo
Date: Mon Aug  8 05:25:51 2011
New Revision: 224703
URL: http://svn.freebsd.org/changeset/base/224703

Log:
  In rtinit1(), before rtrequest1_fib() is called, info.rti_flags is
  initialized by flags (function argument) or-ed with ifa->ifa_flags.
  If both NIC has a loopback route to itself, so IFA_RTSELF is set on ifa(s).
  As IFA_RTSELF is defined by RTF_HOST, rtrequest1_fib() is called with
  RTF_HOST flag even if netmask is not NULL. Consequently, netmask is set
  to zero in rtrequest1_fib(), and request to add network route is changed
  under hands to request to add host route.
  
  Tested by:	Andrew Boyer <aboyer at averesystems.com>
  Submitted by:	Svatopluk Kraus <onwahe at gmail dot com>
  Approved by:	re (hrs)

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Mon Aug  8 05:22:09 2011	(r224702)
+++ head/sys/net/route.c	Mon Aug  8 05:25:51 2011	(r224703)
@@ -1478,7 +1478,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int
 		 */
 		bzero((caddr_t)&info, sizeof(info));
 		info.rti_ifa = ifa;
-		info.rti_flags = flags | ifa->ifa_flags;
+		info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF);
 		info.rti_info[RTAX_DST] = dst;
 		/* 
 		 * doing this for compatibility reasons


More information about the svn-src-head mailing list