Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xroutes generated from local addresses are missing v4mapped src_prefix #47

Closed
fblaese opened this issue Nov 7, 2019 · 3 comments
Closed

Comments

@fblaese
Copy link
Contributor

fblaese commented Nov 7, 2019

Routes imported from kernel had an incorrectely set src_prefix/src_plen before the issue was fixed in 68b6c5e

Just like it, src_prefix/src_plen isn't encoded properly for routes generated from local addresses.

This leads to issues if the same route/address is announced by multiple babeld nodes, as the route generated locally and the route received from a neighbour are not equal internally.

@fblaese
Copy link
Contributor Author

fblaese commented Nov 7, 2019

local addresses are imported from kernel as addresses, so the v4 mapping of src_prefix/src_plen cannot be done like it is done with prefix in kernel_netlink.c:

v4tov6(res->s6_addr, RTA_DATA(rta));

The addresses are converted to routes in filter_address() inside xroute.c, where plen is set to 128 (correct for both v4 and v6):

babeld/xroute.c

Lines 278 to 283 in d42c1db

route = &routes[*found];
memcpy(route->prefix, addr->addr.s6_addr, 16);
route->plen = 128;
route->metric = 0;
route->ifindex = addr->ifindex;
route->proto = RTPROT_BABEL_LOCAL;

@dtaht
Copy link

dtaht commented Apr 6, 2020

I think I might be seeing this...

@jech
Copy link
Owner

jech commented Apr 17, 2020

Fixed in 079bea9.

@jech jech closed this as completed Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants