[patch] Problem with two NIC on same NET (in_scrubprefix: err=17, new prefix add failed)

From: Svatopluk Kraus <onwahe_at_gmail.com>
Date: Wed, 3 Aug 2011 16:51:32 +0200
I have two NIC on same NET (both are up). If a NIC which installs
network route is going down then an error happens during network route
replacement (in_scrubprefix: err=17, new prefix add failed).

  I've done a little bit investigation. In rtinit1(), before
rtrequest1_fib() is called, info.rti_flags is initialized by flags
(function argument) or-ed with ifa->ifa_flags. 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. It is the reason of logged info
and my problem.

  When I've done more investigation, it looks similar to
http://svnweb.freebsd.org/base?view=revision&revision=201543. So, I
propose the following patch.

Index: sys/net/route.c
===================================================================
--- sys/net/route.c	(revision 224635)
+++ sys/net/route.c	(working copy)
_at__at_ -1478,7 +1478,7 _at__at_
 		 */
 		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 reason


  Is the patch sufficient?

      Svata
Received on Wed Aug 03 2011 - 12:51:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:16 UTC