Closed lisongmin closed 1 month ago
I don't know how to set to using unicast address, but it just work
14:33:08.610940 IP (tos 0x0, ttl 16, id 28928, offset 0, flags [none], proto UDP (17), length 366)
0.0.0.0.68 > 255.255.255.255.67: [no cksum] BOOTP/DHCP, Request from ce:18:d4:e1:99:4c, length 338, xid 0x4c6a0e05, Flags [none] (0x0000)
Client-IP 192.168.4.143
Client-Ethernet-Address ce:18:d4:e1:99:4c
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Request
Client-ID (61), length 74: "98184616c91f15419f5cacd012697f85afaa2daeb5d3233e28b0ec21589fb45a/iot/eth1"
Hostname (12), length 13: "homeassistant"
Parameter-Request (55), length 1:
Subnet-Mask (1)
END (255), length 0
14:33:08.611137 IP (tos 0xc0, ttl 64, id 60414, offset 0, flags [DF], proto UDP (17), length 311)
192.168.4.1.67 > 192.168.4.143.68: [bad udp cksum 0x8b15 -> 0x844f!] BOOTP/DHCP, Reply, length 283, xid 0x4c6a0e05, Flags [none] (0x0000)
Your-IP 192.168.4.143
Client-Ethernet-Address ce:18:d4:e1:99:4c
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: ACK
Lease-Time (51), length 4: 60
Subnet-Mask (1), length 4: 255.255.255.0
Default-Gateway (3), length 4: 192.168.4.1
Domain-Name-Server (6), length 4: 192.168.4.1
TZ-Name (101), length 7: "Etc/UTC"
Server-ID (54), length 4: 192.168.4.1
END (255), length 0
We can't just edit vendor files; they need to exactly match upstream. If our library has a bug, we should ideally fix that or find a new library.
We can't just edit vendor files; they need to exactly match upstream. If our library has a bug, we should ideally fix that or find a new library.
Oh, I didn't realize that was vendor code.
Since the upstream code has been inactive for 6 years, I think we should switch to https://github.com/insomniacslk/dhcp.
What do you think? Any other good ideas?
@lisongmin sounds good! If it's a difficult replacement, let me know and we can consider forking. But in general, it's better to switch to a supported upstream :-).
Main changed in this PR:
--resendtimeout
daemon option, the resend timeout represent the total duration we should wait for acquire/renew to complete, and if it is expire, no more retries.It seems there is a test error, but not relative to this PR:
• [FAILED] [0.011 seconds]
sbr test [It] Works with multiple IPs
/home/runner/work/plugins/plugins/plugins/meta/sbr/sbr_linux_test.go:406
[FAILED] Expected
<bool>: false
to be true
In [It] at: /home/runner/work/plugins/plugins/plugins/meta/sbr/sbr_linux_test.go:522 @ 09/20/24 03:58:32.946
It seems there is a test error, but not relative to this PR:
• [FAILED] [0.011 seconds] sbr test [It] Works with multiple IPs /home/runner/work/plugins/plugins/plugins/meta/sbr/sbr_linux_test.go:406 [FAILED] Expected <bool>: false to be true In [It] at: /home/runner/work/plugins/plugins/plugins/meta/sbr/sbr_linux_test.go:522 @ 09/20/24 03:58:32.946
I looked into it, I will try to fix it soon. An issue has been created: https://github.com/containernetworking/plugins/issues/1096
I have rebased to the latest code, feel free to have a look at it, thanks.
@lisongmin looks good! Just needs a minor rebase, then we can get this in.
Great to hear that. And the rebase is done.
The dhcp server is systemd-networkd, and the dhcp plugin can request an ip but can not renew it. The systemd-networkd just ignore the renew request.
Follow the https://datatracker.ietf.org/doc/html/rfc2131#section-4.3.6, following options must not be sent in renew
And renew should using unicast but not broadcast.