Hi,

Martin thank you for your quick reply.

On Wed, Aug 31, 2016, at 22:44, Martin Pieuchot wrote:
> Hello,
> 
> On 08/31/16 22:34, Andrei-Marius Radu wrote:
> > I've recently updated to the 28th of August snapshot and I've discovered 
> > that I
> > cannot add static routes with an indirect next-hop, for example where the 
> > gateway
> > address is not directly connected on an interface but is known via another 
> > static
> > route.
> >
> > I believe that this was introduced by the changes in sys/net/route.c at 
> > revision 1.316
> > after which rt_setgwroute can return ELOOP.
> 
> Yes, this is because the check that was previously done during the hot 
> path is now done when you add a route.
> 
> As you might have see the function is now returning ELOOP but the check 
> was already there before and silently ignored.
> 
> > I was previously running the 13th of August snapshot and in that version I 
> > didn't
> > have any problems related to this.
> 
> I don't know how this could work because gateway route must not point to 
> gateway routes,  nothing has changed in this regard.

Coming from a cisco/juniper background it's perfectly valid for a static route 
to point
to a non-directly-connected next-hop as long as the next-hop can be recursively 
resolved. I guess that for bgpd/ospfd the indirection is resolved by the 
protocol
daemon before adding the route into the kernel.

If it's in any way useful I can run some tests on an older snapshot to show that
packet forwarding was actually working fine.

If on the other hand the current behaviour is considered the correct and 
expected one
then I'll just have to adapt to it and not forget to thank everyone for a great 
operating
system.

> 
> > Here is a simple example. If there is any other information that I can 
> > provide please
> > let me know.
> >
> > user@laptop ~ $ sysctl kern.version
> > kern.version=OpenBSD 6.0-current (GENERIC.MP) #2400: Sun Aug 28 12:30:07 
> > MDT 2016
> >     [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> >
> > user@laptop ~ $ ifconfig em0
> > em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >         lladdr 54:ee:75:88:d9:89
> >         index 1 priority 0 llprio 3
> >         groups: egress
> >         media: Ethernet autoselect (1000baseT 
> > full-duplex,master,rxpause,txpause)
> >         status: active
> >         inet 192.168.1.99 netmask 0xffffff00 broadcast 192.168.1.255
> >
> > user@laptop ~ $ route -n show -inet
> > Routing tables
> >
> > Internet:
> > Destination        Gateway            Flags   Refs      Use   Mtu  Prio 
> > Iface
> > 224/4              127.0.0.1          URS        0        0 32768     8 lo0
> > 127/8              127.0.0.1          UGRS       0        0 32768     8 lo0
> > 127.0.0.1          127.0.0.1          UHl        6     3549 32768     1 lo0
> > 192.168.1/24       192.168.1.99       UC         0        0     -     4 em0
> > 192.168.1.99       54:ee:75:88:d9:89  UHLl       0        0     -     1 em0
> > 192.168.1.255      192.168.1.99       UHb        0        0     -     1 em0
> >
> > user@laptop ~ $ doas route add 192.168.2.0/24 192.168.1.1
> > add net 192.168.2.0/24: gateway 192.168.1.1
> >
> > user@laptop ~ $ route -n show -inet
> > Routing tables
> >
> > Internet:
> > Destination        Gateway            Flags   Refs      Use   Mtu  Prio 
> > Iface
> > 224/4              127.0.0.1          URS        0        0 32768     8 lo0
> > 127/8              127.0.0.1          UGRS       0        0 32768     8 lo0
> > 127.0.0.1          127.0.0.1          UHl        6     3837 32768     1 lo0
> > 192.168.1/24       192.168.1.99       UC         1        0     -     4 em0
> > 192.168.1.1        link#1             UHLc       1        2     -     4 em0
> > 192.168.1.99       54:ee:75:88:d9:89  UHLl       0        0     -     1 em0
> > 192.168.1.255      192.168.1.99       UHb        0        0     -     1 em0
> > 192.168.2/24       192.168.1.1        UGS        0        0     -     8 em0
> >
> > user@laptop ~ $ doas route add 192.168.3.0/24 192.168.2.1
> > add net 192.168.3.0/24: gateway 192.168.2.1: Too many levels of symbolic 
> > links
> >
> > user@laptop ~ $ route -n show -inet
> > Routing tables
> >
> > Internet:
> > Destination        Gateway            Flags   Refs      Use   Mtu  Prio 
> > Iface
> > 224/4              127.0.0.1          URS        0        0 32768     8 lo0
> > 127/8              127.0.0.1          UGRS       0        0 32768     8 lo0
> > 127.0.0.1          127.0.0.1          UHl        6     3981 32768     1 lo0
> > 192.168.1/24       192.168.1.99       UC         1        0     -     4 em0
> > 192.168.1.1        link#1             UHLc       1        2     -     4 em0
> > 192.168.1.99       54:ee:75:88:d9:89  UHLl       0        0     -     1 em0
> > 192.168.1.255      192.168.1.99       UHb        0        0     -     1 em0
> > 192.168.2/24       192.168.1.1        UGS        0        2     -     8 em0
> >
> > --
> > Andrei.
> >
> 

--
Andrei.

Reply via email to