Subject: Re: kern/33279
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Tommy Beadle <tbeadle@gmail.com>
List: netbsd-bugs
Date: 05/11/2006 13:35:02
The following reply was made to PR kern/33279; it has been noted by GNATS.

From: "Tommy Beadle" <tbeadle@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/33279
Date: Thu, 11 May 2006 09:32:30 -0400

 ------=_Part_6610_9427890.1147354350061
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 I have encountered the same issue and it actually appears to be a result of
 the "route flush" that is called from within the startup script.  Before
 performing a route flush, the local link-local address has a routing table
 entry with the UHL flags (not 'c'):
 
 fe80::202:b3ff:fe48:8fd5%fxp0      00:02:b3:48:8f:d5
 UHL         0        0      -  lo0
 
 After doing the route flush, it later clones the interface route:
 
 fe80::202:b3ff:fe48:8fd5%fxp0      00:02:b3:48:8f:d5
 UHLc        0        0      -  lo0
 
 which is resulting in what was previously described by dyoung.  I have
 modified my /usr/src/sbin/route/route.c with the following patch so that,
 when performing the route flush, the UHL (without the 'c') flagged entries
 are not deleted:
 
 --- route.old.c 2006-05-10 18:00:32.000000000 -0400
 +++ route.c     2006-05-10 18:00:59.000000000 -0400
 @@ -309,9 +309,14 @@
                 rtm =3D (struct rt_msghdr *)next;
                 if (verbose)
                         print_rtmsg(rtm, rtm->rtm_msglen);
 -               if (!(rtm->rtm_flags & (RTF_GATEWAY | RTF_STATIC |
 -                                       RTF_LLINFO)) && !doall)
 +               if (!(
 +                     (rtm->rtm_flags & (RTF_GATEWAY | RTF_STATIC)) ||
 +                     (((rtm->rtm_flags & (RTF_LLINFO | RTF_CLONED)) =3D=3D
 (RTF_LLINFO | RTF_CLONED)))
 +                   )
 +                   && !doall)
 +               {
                         continue;
 +               }
                 if (af) {
                         struct sockaddr *sa =3D (struct sockaddr *)(rtm + 1=
 );
 
 I don't know if this is the "right" fix, but it is working for me.
 
 Regards,
 Tommy Beadle
 
 ------=_Part_6610_9427890.1147354350061
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 I have encountered the same issue and it actually appears to be a
 result of the &quot;route flush&quot; that is called from within the startu=
 p
 script.&nbsp; Before performing a route flush, the local link-local
 address has a routing table entry with the UHL flags (not 'c'):<br>
 <br>
 fe80::202:b3ff:fe48:8fd5%fxp0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 00:02:b3:48:8f:d5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
 p;&nbsp;&nbsp;&nbsp;
 UHL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp; lo0<br>
 <br>
 After doing the route flush, it later clones the interface route:<br>
 <br>
 fe80::202:b3ff:fe48:8fd5%fxp0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 00:02:b3:48:8f:d5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
 p;&nbsp;&nbsp;&nbsp;
 UHLc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp; lo0<br>
 <br>
 which is resulting in what was previously described by dyoung.&nbsp; I
 have modified my /usr/src/sbin/route/route.c with the following patch
 so that, when performing the route flush, the UHL (without the 'c')
 flagged entries are not deleted:<br>
 <br>
 --- route.old.c 2006-05-10 18:00:32.000000000 -0400<br>
 +++ route.c&nbsp;&nbsp;&nbsp;&nbsp; 2006-05-10 18:00:59.000000000 -0400<br>
 @@ -309,9 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p;&nb=
 sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 struct sockaddr *sa =3D (struct sockaddr *)(rtm + 1);<br>
 <br>
 I don't know if this is the &quot;right&quot; fix, but it is working for me=
 .<br>
 <br>
 Regards,<br>
 Tommy Beadle<br>
 
 ------=_Part_6610_9427890.1147354350061--