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

Initial attempt at adding multiple pd to scripts #28

Closed

Conversation

jrmithdobbs
Copy link
Contributor

@jrmithdobbs jrmithdobbs commented Apr 16, 2021

This adds all pds besides zero with their identifier as a base10 int after
PDINFO in the variable name, a PDCOUNT variable, as well as related PDIF with a
space separated list of {interface}:{sla_len}:{sla_id} following same naming as
PDINFO, a CDUID (client) and SDUID (server) so that this information can be
passed to other systems.

For example where the second pd has no interfaces:

SDUID=<serverDUID>
CDUID=<interfaceDUID>
PDINFO=1111:1111:1111::/56
PDIF=vlan1:8:0 vlan2:8:2 vlan3:8:3
PDINFO1=1111:1111:1112::/56
PDINFO2=1111:1111:1113::/56
PDIF2=vlan4:8:0
PDCOUNT=3

This addresses (and then some) #19.

@jrmithdobbs

This comment has been minimized.

dhcp6c_script.c Outdated Show resolved Hide resolved
common.c Outdated Show resolved Hide resolved
config.c Outdated Show resolved Hide resolved
@jrmithdobbs jrmithdobbs force-pushed the multi_pd_script_support branch from d9c2f4b to e29c27f Compare April 18, 2021 01:17
This adds all pds besides zero with their identifier as a base10 int after
PDINFO in the variable name, a PDCOUNT variable, as well as related PDIF with a
space separated list of {interface}:{sla_len}:{sla_id} following same naming as
PDINFO, a CDUID (client) and SDUID (server) so that this information can be
passed to other systems.

For example where the second pd has no interfaces:
```
SDUID=<serverDUID>
CDUID=<interfaceDUID>
PDINFO=1111:1111:1111::/56
PDIF=vlan1:8:0 vlan2:8:2 vlan3:8:3
PDINFO1=1111:1111:1112::/56
PDINFO2=1111:1111:1113::/56
PDIF2=vlan4:8:0
PDCOUNT=3
```

This addresses (and then some) opnsense#19.
@jrmithdobbs
Copy link
Contributor Author

The majority of these changes apply to the REPLY to the initial REQUEST if there are multiple PDs being requested/offered.

It would be nice if the address decided to be assigned was also available in the script but I’ve not read through enough of dhcp6c_ia.c to tell where/if that’s being stored or what needs to be plumbed to make it available here.

The sla_len and sla_id values combined with the knowledge that it uses the link-local address for the postfix at least make it derivable. Maybe the separator shouldn’t be : so that the assigned address could be added later?

This changes the seperator from : to , and now formats the PDIF* vars as
if,ipv6-addr-assigned.
Superpaul209 added a commit to Superpaul209/FreeBSD-ports that referenced this pull request Jul 29, 2022
Improvements include the following:

- Reload the client configuration on SIGHUP
- Removed all unused binaries except dhcp6c
- Raw option send and receive support
- PDINFO delegated prefix environment variable
- Accept interfaces from the configuration file

- Increased log verbosity.
- Fix socket leakage by setting FD_CLOEXEC.
- Call a configuration script after addresses and prefixes are set
  on an interface.
- Update ifid on interface restart, it may have changed.
- "-n" flag to prevent address release from being sent to the DHCP server
  upon restart.

- Merged PR : opnsense/dhcp6c#28
- Merged PR : opnsense/dhcp6c#29
- Merged PR : opnsense/dhcp6c#30
@fichtner fichtner self-assigned this May 10, 2023
@fichtner fichtner closed this in c334339 May 10, 2023
@fichtner
Copy link
Member

@jrmithdobbs if you still read this and are interested. I've chosen the smallest approach here to inject all prefixes into PDINFO variable only. I don't mind adding SDUID and CDUID per se, but it's a bit of a side quest as well as restructuring the information given here since we would start one script per interface anyway which makes PDINFO scope local. Otherwise we would probably have to emit the interface as well (not even counting internal vs. external reference name in OPNsense). Happy about further PRs.

Cheers,
Franco

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

Successfully merging this pull request may close these issues.

2 participants