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

FS#1430 - MAP rule parsing incorrectly handles additional FMR rules #6607

Closed
openwrt-bot opened this issue Mar 14, 2018 · 1 comment
Closed
Labels

Comments

@openwrt-bot
Copy link

detobate:

When [[https://github.com/openwrt/openwrt/blob/master/package/network/ipv6/map/files/map.sh#L117-L122|map.sh parses FMR rules]], it incorrectly assumes that all FMR rules should have remote.style MAP.

Only FMRs pointing towards other MAP CPEs should use remote.style MAP. Other destinations (such as CDNs or other IPv6 servers), should use remote.style RFC6052
This distinction could be inferred when both remote.ea-len and remote.psid-offset are 0. (Although this wouldn't be 100% accurate, as it's possible a deployment might do 1:1 v4:v6 mapping, use multiple MAP domains and have FMRs for each MAP domains)

Another method could be to check to see if the remote.v4 and remote.v6 pair has been seen previously as local.v4 and local.v6. If it has, then it should use style MAP. If the pair hasn't been seen, then it should use style RFC6052. This would require the network admin to make sure all MAP domain BMRs are sent to all CPEs, regardless of which domain they're in.

As an additional side bug, mapcalc.c appears to generate a negative PSIDLEN when presented with an FMR that has EALEN 0.
This appears to only be aesthetic when generating /tmp/map-wan6_4.rules
I believe this could be resolved by adjusting:
[[https://github.com/openwrt/openwrt/blob/master/package/network/ipv6/map/src/mapcalc.c#L312|if (psidlen <= 0) {]]
to:
if (psidlen <= 0) && (ealen > 0) {

@openwrt-bot
Copy link
Author

detobate:

DHCPv6 Option 95 used: 0059001601081c027ffe00302a020c7afe40005d000406000000005b0009402a020c7afdff00000059001801001c5adfbec0402a020c7a8000fe07005d000400000000

This includes the DMR, the BMR (with FMR bit enabled), and an additional distinct FMR rule.

Alternate version, with the FMR's EALEN set to 4, to offset the autogenerated PSID_LEN as mentioned above:
0059001601081c027ffe00302a020c7afe40005d000406000000005b0009402a020c7afdff00000059001801041c5adfbec0402a020c7a8000fe07005d000400000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant