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

internal/*: add PREF64 support #42

Closed
wants to merge 1 commit into from
Closed

Conversation

jmbaur
Copy link
Contributor

@jmbaur jmbaur commented Mar 11, 2024

Adds initial PREF64 support. Multiple prefixes can be added on an interface, defaulting to a single prefix of the RFC 6052 reserved value "64:ff9b::/96" if the config's TOML section is defined but the prefix value is either unset or empty.

Closes #24

go.mod Outdated
@@ -31,3 +31,5 @@ require (
golang.org/x/text v0.10.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)

replace github.com/mdlayher/ndp => github.com/jmbaur/ndp v0.0.0-20240310235550-d810a7ebc0fa
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on these changes. Plan is to remove this if/when the ndp changes are merged

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM! I will happily accept this contribution and the one to ndp.

@jmbaur
Copy link
Contributor Author

jmbaur commented Mar 11, 2024

Been testing out these changes on my home network and it appears to be working well. Android's clatd is using the pref64 prefix advertised from corerad and works when tested using IPv4 literals. Also tested on a generic linux workstation using tcpdump and changes from this patch with the following results (pref64 option at the bottom):

$ sudo tcpdump --interface wlan0 -v "icmp6"
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
...redacted...
23:42:41.224999 IP6 (flowlabel 0x59d0f, hlim 255, next-header ICMPv6 (58) payload length: 16) hostname > ff02::2: [icmp6 sum ok] ICMP6, router solicitation, length 16
	 source link-address option (1), length 8 (1): redacted
23:42:41.306765 IP6 (flowlabel 0x18f6f, hlim 255, next-header ICMPv6 (58) payload length: 152) _gateway > hostname: [icmp6 sum ok] ICMP6, router advertisement, length 152
	hop limit 64, Flags [none], pref medium, router lifetime 1800s, reachable time 0ms, retrans timer 0ms
	 prefix info option (3), length 32 (4): redacted::/64, Flags [onlink, auto], valid time 86400s, pref. time 14400s
	 prefix info option (3), length 32 (4): redacted::/64, Flags [onlink, auto], valid time 86400s, pref. time 14400s
	 rdnss option (25), length 24 (3):  lifetime 1200s, addr: redacted
	 dnssl option (31), length 24 (3):  lifetime 1200s, domain(s): home.arpa.
	 source link-address option (1), length 8 (1): redacted
	 pref64 info option (38), length 16 (2): 64:ff9b::/96 (plc 0), lifetime 600s

Copy link
Owner

@mdlayher mdlayher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall so far. Let's sync up on your NDP PR and figure out where the maxInterval calculation should live (I am leaning CoreRAD) and then we can circle back on this one.

I'll plan to tag a new release once this is merged so we can both deploy it in NixOS.

go.mod Outdated
@@ -31,3 +31,5 @@ require (
golang.org/x/text v0.10.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)

replace github.com/mdlayher/ndp => github.com/jmbaur/ndp v0.0.0-20240310235550-d810a7ebc0fa
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM! I will happily accept this contribution and the one to ndp.

internal/config/config.go Outdated Show resolved Hide resolved
internal/config/plugin.go Outdated Show resolved Hide resolved
internal/config/reference.toml Show resolved Hide resolved
internal/plugin/plugin.go Outdated Show resolved Hide resolved
@jmbaur jmbaur force-pushed the pref64 branch 3 times, most recently from 3b87369 to 6e88dd9 Compare March 12, 2024 13:53
go.mod Outdated Show resolved Hide resolved
internal/plugin/plugin.go Show resolved Hide resolved
internal/plugin/plugin.go Show resolved Hide resolved
internal/plugin/plugin.go Outdated Show resolved Hide resolved
internal/plugin/plugin.go Outdated Show resolved Hide resolved
internal/plugin/plugin.go Show resolved Hide resolved
Adds initial PREF64 support. Multiple prefixes can be added on an
interface, defaulting to a single prefix of the RFC 6052 reserved value
"64:ff9b::/96" if the config's TOML section is defined but the prefix
value is either unset or empty.
@mdlayher
Copy link
Owner

Cherry-picked to main with a couple of minor nits and to fix the formatting, thank you!! I'll cut a new tag.

@mdlayher mdlayher closed this Mar 12, 2024
@jmbaur
Copy link
Contributor Author

jmbaur commented Mar 12, 2024

Thanks for the thorough reviews!

@jmbaur jmbaur deleted the pref64 branch March 12, 2024 18:49
@mdlayher
Copy link
Owner

@jmbaur It would appear I haven't reinstalled nix on this machine so I can't easily bump the NixOS package right now; would you be willing to submit a PR for that and I can +1 it as the maintainer? I'll work on getting the tooling set up in the meantime.

@jmbaur
Copy link
Contributor Author

jmbaur commented Mar 12, 2024

Sure thing, PR is here: NixOS/nixpkgs#295391

@alexhaydock
Copy link

Great stuff - you managed to beat radvd to shipping a release with PREF64!

I've marked the Alpine package as out of date upstream. I'm not the maintainer but hopefully this new release will get picked up soon in Edge and I'll do some testing.

@alexhaydock
Copy link

1.3.0 is now shipping in Alpine Edge and confirmed working sending PREF64. Thanks for working on this! 🥳

image

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

Successfully merging this pull request may close these issues.

internal/corerad: support for RFC8781 PREF64 option
3 participants