[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#646961: patch



El 5 d’abril de 2012 11:37, Michael Tokarev <mjt@tls.msk.ru> ha escrit:
> I also wonder if we can just test for /lib/freebsd/route
> existance instead of checking $(uname -r) ?
>
> Somehow I'm not comfortable with the uname check...

It doesn't make a difference now.  But what will you do when we remove
the wrapper and move /lib/freebsd/route back to /sbin?  Then you will
need uname.

> Besides, where I can see the /sbin/route wrapper currently
> in use on kfreebsd?

http://anonscm.debian.org/viewvc/glibc-bsd/trunk/freebsd-utils/debian/local/scripts/sbin/route?revision=3715&view=markup

>  # /lib/freebsd/route del -net 0.0.0.0 0.0.0.0 dev re0
>  route: bad address: dev
>
> This is freebsd-net-tools 8.2+ds3-2.
>
> Does it support "dev" ?

Looks like it doesn't.  My code was a direct translation of what the
wrapper converted commands to, but it seems this is not enough.

In this case we'll have to remove "dev $interface".

> this difference can be reduced further:
>
>    /sbin/route add -net 0.0.0.0 gw $i dev $interface metric $metric
>
> so we now have just two differences: the command name and "gw"
> keyword.  /sbin/route script from freebsd-net-tools will just
> strip "gw", so it should work without any changes.
>
> But it will also remove metric and dev, at least if I understand
> the code -- this should be easy to fix in the script.

I don't understand this line of reasoning.  Do you realize the wrapper
script is planned to disappear?

You can't archieve compatible CLI among net-tools/Linux route and
FreeBSD route.  They were never meant to be compatible.  All existing
portable DHCP clients adapt to this and ship separate setup scripts
for each platform.

> Besides, I'm not really sure why/when/how several routes can
> be present.

You mean because interfaces are not specified?  The kernel associates
routes with interfaces automatically, try "netstat -nr" and check the
output.

-- 
Robert Millan



Reply to: