On 28/04/14(Mon) 22:57, Martin Pieuchot wrote:
> On 28/04/14(Mon) 21:51, Stuart Henderson wrote:
> > On 2014/04/28 19:09, Martin Pieuchot wrote:
> > > On 28/04/14(Mon) 17:53, Stuart Henderson wrote:
> > > > On 2014/04/28 18:39, Martin Pieuchot wrote:
> > > > > On 28/04/14(Mon) 17:32, Stuart Henderson wrote:
> > > > > > On 2014/04/28 17:15, Stuart Henderson wrote:
> > > > > > > This breaks my setup,
> > > > > > >
> > > > > > > # /sbin/route add -inet6 default -ifp pppoe1 fe80::
> > > > > > > route: writing to routing socket: Network is unreachable
> > > > > > > add net default: gateway fe80::: Network is unreachable
> > > > > > >
> > > > > >
> > > > > > hmmm... actually it seems something that was committed broke this;
> > > > > > any suggestions of likely candidates?
> > > > >
> > > > > Concerning routing & inet6 that might be the rt_ifa_add_loop()
> > > > > committed
> > > > > on the 3rd of April, but you tested and ok'd it or the rtinit() ->
> > > > > rt_ifa_add() conversion committed the 10th of April.
> > > >
> > > > Window narrowed to between these:
> > > >
> > > > OpenBSD 5.5-current (GENERIC.MP) #61: Tue Apr 8 17:28:01 MDT
> > > > 2014
> > > > OpenBSD 5.5-current (GENERIC.MP) #63: Thu Apr 10 20:45:05 MDT
> > > > 2014
> > > >
> > > > Could it be in6.c 1.135? (I need to stop breaking my net for a bit to
> > > > get some other things done..)
> > >
> > > I doubt it will be this one since it's just removing a wrapper, but I
> > > don't see anything else in this timeframe.
> > >
> >
> > This is the one that breaks it, I can't just pull this diff out
> > though, other things are stacked on top.
>
> Thanks for finding it, I'll cook a fix then.
Here's a diff that fixes it in a way that allows me to remove the lladdr
from the global lists.
So the story behind this crap is horrible. Basically when you do:
# route -ifp pppoe1
route(8) encodes the interface name into "sdl_data" using link_addr(3).
This function is used only once and takes a crazy string argument like:
em0:00.18.91.13.ed.30, really? But in your case, it only copy "pppoe1".
Then to really obfuscate the things, ifa_ifwithnet() was comparing this
name like if it was an address...
So makes thing obvious and call ifunit() directly if we didn't find an
ifp with sdl_index.
Ok?
Index: net/route.c
===================================================================
RCS file: /home/ncvs/src/sys/net/route.c,v
retrieving revision 1.164
diff -u -p -r1.164 route.c
--- net/route.c 25 Apr 2014 10:41:09 -0000 1.164
+++ net/route.c 29 Apr 2014 08:55:15 -0000
@@ -658,6 +658,8 @@ ifa_ifwithroute(int flags, struct sockad
struct sockaddr_dl *sdl = (struct sockaddr_dl *)gateway;
struct ifnet *ifp = if_get(sdl->sdl_index);
+ if (ifp == NULL)
+ ifp = ifunit(sdl->sdl_data);
if (ifp != NULL)
ifa = ifp->if_lladdr;
} else {
@@ -702,6 +704,8 @@ rt_getifa(struct rt_addrinfo *info, u_in
sdl = (struct sockaddr_dl *)info->rti_info[RTAX_IFP];
ifp = if_get(sdl->sdl_index);
+ if (ifp == NULL)
+ ifp = ifunit(sdl->sdl_data);
}
if (info->rti_ifa == NULL && info->rti_info[RTAX_IFA] != NULL)