[PATCH] Netlink: add krt_scope attribute

Ondrej Zajicek santiago at crfreenet.org
Thu Sep 15 22:36:11 CEST 2016


On Thu, Sep 15, 2016 at 09:22:02PM +0200, Vincent Bernat wrote:
> > I though that kernel sets scope link automatically for device routes,
> > but in reality it is done by ip tool. Perhaps we should do that too.
> 
> For device routes created by the kernel, scope is link, but if you
> create them manually, you get a global scope.

My point was that 'ip' tool does that automatically for users:

# ip r a 10.1.1.0/24 dev eth0
# ip r l
10.1.1.0/24 dev eth0  scope link 

Perhaps we should do that too. The fact that we do not set link scope
for device routes sent to kernel is probably an oversight, not by design.

I think reasonable behavior would be like:

if route has krt_scope attribute
  -> use that
else if it is device route
  -> use link
else
  -> use universe

And in other direction (kernel->bird):
if route has expected scope (link for device, universe otherwise)
  -> do not set krt_scope
else
  -> set krt_scope


-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20160915/e5ea8778/attachment.asc>


More information about the Bird-users mailing list