Git Product home page Git Product logo

Comments (5)

T-X avatar T-X commented on June 14, 2024 1

Yes, it does, thanks :-).

from pim6sd.

troglobit avatar troglobit commented on June 14, 2024

Awesome bug report, very much appreciate your attention to detail! I'll have a look at it on Friday evening at the latest, I'm a bit swamped right now with personal matters.

from pim6sd.

T-X avatar T-X commented on June 14, 2024

Hm, I think this debug output gives a hint to the issue:

[...]
23:19:07.988 NETLINK: ask path to fd5c:725:2841:1::3
23:19:07.988 NETLINK: vif 0, ifindex=5
23:19:07.988 NETLINK: gateway is fd5c:725:2841::2
23:19:07.988 For src fd5c:725:2841:1::3, iif is wan0, next hop router is fd5c:725:2841::2%5: NOT A PIM ROUTER
---------------------------RP-Set----------------------------
Current BSR address: fd5c:725:2841::2 Prio: 0 Timeout: 145
RP-address(Upstream)/Group prefix             Prio Hold Age
fd5c:725:2841:1::3(none)
     ff13:23:42:ffff::/64                     0    150  135
[...]

The route towards the BSR on router0 is this one:

fd5c:725:2841:1::/64 via fd5c:725:2841::2 dev wan0 metric 1024 pref medium

Therefore the kernel reports fd5c:725:2841::2%5 as the router and not the link-local one used in the IPv6 source address in PIM messages.

So now as it's not the primary PIM address, the link-local one, set_incoming() in src/route.c now checks the aux addresses in a loop (n->aux_addrs).

The issue here is that the kernel reported a router address with an interface index (neighbor_addr->sin6_scope_id) of 5. However the addresses in n->aux_addrs are all stored with a scope id of 0. Therefore the inet6_equal(&neighbor_addr, &pa->pa_addr) in set_incoming() does not match.


I'm not quite sure how to fix this. There could be several ways:

A) Set the scope id of the neighbor_addr the kernel route request returned to 0 before calling inet6_equal() on the aux_addr (but only before the aux_addr check, as the primary one, n->address is stored with a sin6_scope_id...).

B) Store the sin6_scope_id in the addresses of aux_addr, too (but check what other places, especially the ones calling inet6_equal(), expect)

C) Avoid checking the sin6_scope_id in inet6_equal() if it is 0 for one of the provided address.

D) Provide the (link-local) IPv6 source address of the PIM bootstrap message, including the sin6_scope_id, to set_incoming() instead of the BSR address.

from pim6sd.

T-X avatar T-X commented on June 14, 2024

Ok, as far as I can tell, aux_addr is only ever used in set_incoming for precisely this check. So should be save to just set the correct sin6_scope_id in parse_pim6_hello(), which is where the objects for aux_addr are malloc'd and initialized.

I'm going to try a patch.

from pim6sd.

troglobit avatar troglobit commented on June 14, 2024

Just to double check, PR #15 fixes this issue, right?

from pim6sd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.