-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fix an issue on RP hash calculations. #93
Conversation
As per RFC4601, all multicast routers in a domain should use the same algorithm for RP elections, and all the IP addresses including the mask address used in the algorithm should be in host byte order. The change fixes the problem about RP hash calculation so that the results will be consistent across different routers. Signed-off-by: Xiaodong Xu <stid.smth@gmail.com>
Interesting! This looks like it could very well be the root cause to issue #81 The code also looks good. Only real problem I see, apart from introducing an incompatibility with earlier versions of If you could help me shed some light on this detail I'd be most grateful, because I have to write something in the ChangeLog to explain the possible incompatibility with older pimd versions we introduce. |
It doesn't explicitly state that the address/mask has to be in host byte order. But if you look at the following description:
only if the hash mask is in host byte order, can the algorithm hash to the same result for the 4 consecutive group IP addresses within the same subnet of /30. |
Ah, thanks for clearing that up! Wasn't obvious to me at all, although I did read the description several times. Hmm, maybe we should add a command line compatibility switch, or configure option to support users with mixed installations, or even bump the major version ( Good to know this change at least makes it compatible with Cisco! ✌️ |
I agree we need bump the major version and document this new behavior in the release notes. However, I kinda feel that it is a BUG rather than a behavior change. I think you may notice two issues in the hash function, which actually cause unexpected hash value and the result could be unpredictable from the user's perspective. |
Agreed, let's bump major to 3.0 and document in ChangeLog and also recommend users to upgrade all routers in the same domain. It's both reasonable and the only sane option I think. Thanks for the rubber ducking! Yeah, I noticed the ordering bug with OK. I'll start prepping the repo and all meta data for 3.0 and then I'll merge this. |
(I've been thinking about changing command line options and possibly also some |
@xdxu Thank you again for your contribution! 😃 👍 |
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
As per RFC4601, all multicast routers in a domain should use the same
algorithm for RP elections, and all the IP addresses including the mask
address used in the algorithm should be in host byte order. The change fixes
the problem about RP hash calculation so that the results will be consistent
across different routers.
Signed-off-by: Xiaodong Xu stid.smth@gmail.com