-
Notifications
You must be signed in to change notification settings - Fork 94
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
shared-state-publish_dnsmasq_leases recognize IPv6 when IPv6 leases are present #975
shared-state-publish_dnsmasq_leases recognize IPv6 when IPv6 leases are present #975
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #975 +/- ##
==========================================
+ Coverage 77.71% 77.87% +0.15%
==========================================
Files 52 52
Lines 4362 4388 +26
==========================================
+ Hits 3390 3417 +27
+ Misses 972 971 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Just realized that the if statements can be rearranged in a more useful way, will improve in a few days. |
eba7b15
to
0158a34
Compare
Now the if sentences are more useful. |
if type(client_hostname) == "string" and client_hostname:len() > 1 then | ||
-- client_ip will be nil in duid lines | ||
-- https://dnsmasq-discuss.thekelleys.org.narkive.com/ia9YNLmE/dnsmasq-leases-file-format-specification | ||
if client_ip and type(client_hostname) == "string" and client_hostname:len() > 1 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dhcp.leases file contains lines with hostname *
, i.e.
1675107518 12:34:65:3d:ce:2b 10.51.147.128 * 01:12:34:65:3d:ce:2b
1675106752 ab:cd:15:8a:62:93 10.51.147.146 * 01:ab:cd:15:8a:62:93
It is correct that we don't want to add *
into the hostTable
. But I think we still want to add them into the leasesTable
, which will not happen with this arrangement of if-statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, it makes sense, thanks! I am going to correct this today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated, please check it.
Thanks!
0158a34
to
c762ff9
Compare
looks ok, please test it both with |
I have tested it on different routers with and without anygw. It works fine except one thing: As stated in the man-page, when dnsmasq calls the script with |
@pony1k with the current code of this PR, that should not appear at all: a line like
does not get added to But I think I got what you mean: that also this line should be added but using the last field prefixed with |
It does not get added to
I'm not sure if it should. Maybe it's fine to not share ipv6-leases, since collisions are very unlikely. I haven't reflected on this. |
Ooh, ok!
Meh, it shouldn't harm neither. |
Yeah unless a very conflict prone assignation algorithm is used (never saw anything like that, plus it make no sense at all in a mesh network), no need to share IPv6 leases as the collision is so unlikely that also the RFC standards take that for granted. Most probably we didn't share those also with this motivation. As it is not needed, avoid sharing them is better, so the global state is lighter, less RAM is used, less CPU is used, less traffic is generated, everything works better. |
Looks good to me, @pony1k can you test this and report back so we can merge it before re-targeting? |
I have tested it. It works fine. Thank you! |
Thank you both! |
Fix #969
I still have to test the modified code.
@pony1k can you test this?