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

fix misleading listen address in documentation #516

Merged
merged 3 commits into from
May 29, 2024

Conversation

ForestJohnson
Copy link
Contributor

A DHCP server should probably always listen on 0.0.0.0 when we're working on it in development and testing.

Why?

I believe normal DHCP requests are sent as broadcasts to 255.255.255.255... I believe when its broadcasted, every single UDP packet regardless of where it ends up, will have 255.255.255.255 as the destination address. And since 255.255.255.255 != 127.0.0.1, the UDP listener will ignore it.

We can tell our UDP listener to listen on 255.255.255.255 but then it will ONLY receive these "normal" DHCP broadcast packets. If someone tries to send a datagram to it directly (on a specific IP like 127.0.0.1, 192.168.69.1 etc) it wont be received.

So i think 0.0.0.0 is appropriate here, considering that it's already being told to listen on a specific interface.

ForestJohnson and others added 2 commits October 14, 2023 19:26
A DHCP server should probably always listen on `0.0.0.0` when we're working on it in development and testing.

Why? 

I believe normal DHCP requests are sent as broadcasts to `255.255.255.255`...   I believe when its broadcasted, every single UDP packet regardless of where it ends up, will have `255.255.255.255` as the destination address. And since `255.255.255.255` != `127.0.0.1`, the UDP listener will ignore it. 


We can tell our UDP listener to listen on `255.255.255.255`  but then it will ONLY receive these "normal" DHCP broadcast packets.   If someone tries to send a datagram to it directly (on a specific IP like `127.0.0.1`,  `192.168.69.1` etc)  it wont be received. 

So i think `0.0.0.0` is appropriate here, considering that it's already being told to listen on a specific interface.
@pmazzini
Copy link
Collaborator

Please sign the commit. More details in:
https://github.com/insomniacslk/dhcp/pull/516/checks?check_run_id=19055434699

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.06%. Comparing base (c728f5d) to head (91af758).
Report is 8 commits behind head on master.

Current head 91af758 differs from pull request most recent head af24f57

Please upload reports for the commit af24f57 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #516      +/-   ##
==========================================
- Coverage   73.35%   73.06%   -0.29%     
==========================================
  Files          81       89       +8     
  Lines        5104     5491     +387     
==========================================
+ Hits         3744     4012     +268     
- Misses       1217     1324     +107     
- Partials      143      155      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pmazzini pmazzini merged commit 51bc613 into insomniacslk:master May 29, 2024
8 checks passed
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.

None yet

2 participants