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

Exposing advertisments/offers via dhcpcd-run-hooks #304

Open
rmarioe opened this issue Mar 6, 2024 · 2 comments
Open

Exposing advertisments/offers via dhcpcd-run-hooks #304

rmarioe opened this issue Mar 6, 2024 · 2 comments

Comments

@rmarioe
Copy link

rmarioe commented Mar 6, 2024

I would like to have visibility of all the DHCP servers that offered/advertised a lease in the network to the client through my user defined hook script. It could be handled by adding a reason to run the hooks script (i.e. OFFER/ADVERTISE). Before sending out a PR I would like to know if something like this could be an acceptable enhancement to dhcpcd?

@rsmarples
Copy link
Member

dhcpcd currently works on a one to one basis and reacts to the first OFFER/ADVERTISE it gets and then discards the others it receives while it's in the next phase.

What is your use case for this?

@rmarioe
Copy link
Author

rmarioe commented Mar 7, 2024

I want to get configuration data/vendor options of all servers into the hooks environment.

RFC2131 does not mandate this kind of behavior but does allow it:

  1. The client receives one or more DHCPOFFER messages from one or more
    servers. The client may choose to wait for multiple responses.
    The client chooses one server from which to request configuration
    parameters, based on the configuration parameters offered in the
    DHCPOFFER messages.

RFC8415:

  • Those Advertise messages with the highest server preference value
    SHOULD be preferred over all other Advertise messages. The client
    MAY choose a less preferred server if that server has a better set
    of advertised parameters, such as the available set of IAs, as
    well as the set of other configuration options advertised.

  • Within a group of Advertise messages with the same server
    preference value, a client MAY select those servers whose
    Advertise messages advertise information of interest to the
    client.

Having all the info in the environment is enough for me.

If we would go the way of choosing the server in might be trickier.

We could restart the server until the client chooses the correct one in the existing algorithm?
It is first come - first serve currently?

Another way could be for the client to wait for user input on what to choose if the client registered for this hook.

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

No branches or pull requests

2 participants