> Le 25 févr. 2016 à 07:48, Martin Pieuchot <[email protected]> a écrit : > > On 25/02/16(Thu) 00:05, Martin Pieuchot wrote: >> On 24/02/16(Wed) 21:57, Jean-Daniel Dupas wrote: >>>> Le 24 févr. 2016 à 19:58, Martin Pieuchot <[email protected]> a écrit : >>>> >>>> On 24/02/16(Wed) 18:56, Jean-Daniel Dupas wrote: >>>>> Hello, >>>>> >>>>> On OpenBSD 5.7, I'm using alternative route table to send ping a on >>> specific >>>>> route. >>>>> >>>>> On a fresh install, I simply do >>>>> >>>>>> route -T 1 add default 192.168.1.1 >>>>>> ping -V 1 8.8.8.8 >>>>> >>>>> It works well on 5.7, but I can't managed to get it working on 5.8. >>>>> >>>>> On a fresh install of 5.8, doing the same commands result in a "No route >>> to >>>>> host" error. >>>> >>>> Which command result in this error? ping? Is this regression also >>>> present in -current? It is close to 5.9 so fixing this bug now makes >>>> a lot of sense. >>>> >>>> What does "route -T1 get 8.8.8.8" returns you? Are the outputs of >>>> "route -n show" for the table 0 and 1 different between 5.7 and 5.8? >>>> Could you post them? >>> >>> Here is some details. The output of all commands are the same. >>> The only change is that trying to access the network using the custom table >>> fails. >> >> The problem is that there's no entry for your gateway, 10.0.0.1, in the >> table 1 and the kernel no longer link route entries across tables. > > Does the diff below help? > > Index: net/route.c > =================================================================== > RCS file: /cvs/src/sys/net/route.c,v > retrieving revision 1.294 > diff -u -p -r1.294 route.c > --- net/route.c 24 Feb 2016 22:41:53 -0000 1.294 > +++ net/route.c 25 Feb 2016 06:46:23 -0000 > @@ -389,7 +389,8 @@ _rtalloc(struct sockaddr *dst, uint32_t > * this behavior. But it is safe since rt_checkgate() wont > * allow us to us this route later on. > */ > - nhrt = rt_match(rt->rt_gateway, NULL, flags | RT_RESOLVE, rtableid); > + nhrt = rt_match(rt->rt_gateway, NULL, flags | RT_RESOLVE, > + rtable_l2(rtableid)); > if (nhrt == NULL) > return (rt);
Yes, it looks like it fixes my issue. Before that, I did try to add a bunch of entries in the table to mimic the default route table (like you suggested) but didn't managed to make it work. Anyway, thanks for the fix.

