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: [email protected])
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

Attachment: signature.asc
Description: Digital signature

Reply via email to