Skip to content

Commit d61e7e5

Browse files
lisongminsqueed
authored andcommitted
fix(dhcp): can not renew an ip address
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. ``` 2024/09/14 21:46:00 no DHCP packet received within 10s 2024/09/14 21:46:00 retrying in 31.529038 seconds 2024/09/14 21:46:42 no DHCP packet received within 10s 2024/09/14 21:46:42 retrying in 63.150490 seconds 2024/09/14 21:47:45 98184616c91f15419f5cacd012697f85afaa2daeb5d3233e28b0ec21589fb45a/iot/eth1: no more tries 2024/09/14 21:47:45 98184616c91f15419f5cacd012697f85afaa2daeb5d3233e28b0ec21589fb45a/iot/eth1: renewal time expired, rebinding 2024/09/14 21:47:45 Link "eth1" down. Attempting to set up 2024/09/14 21:47:45 98184616c91f15419f5cacd012697f85afaa2daeb5d3233e28b0ec21589fb45a/iot/eth1: lease rebound, expiration is 2024-09-14 22:47:45.309270751 +0800 CST m=+11730.048516519 ``` Follow the https://datatracker.ietf.org/doc/html/rfc2131#section-4.3.6, following options must not be sent in renew - Requested IP Address - Server Identifier Since the upstream code has been inactive for 6 years, we should switch to another dhcpv4 library. The new selected one is https://github.com/insomniacslk/dhcp. Signed-off-by: Songmin Li <[email protected]>
1 parent e495072 commit d61e7e5

File tree

310 files changed

+12784
-11181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+12784
-11181
lines changed

.github/workflows/test.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ jobs:
6767
sudo apt-get install linux-modules-extra-$(uname -r)
6868
- name: Install nftables
6969
run: sudo apt-get install nftables
70+
- name: Install dnsmasq(dhcp server)
71+
run: |
72+
sudo apt-get install dnsmasq
73+
sudo systemctl disable --now dnsmasq
7074
- uses: actions/checkout@v4
7175
- name: setup go
7276
uses: actions/setup-go@v5

go.mod

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ require (
99
github.com/containernetworking/cni v1.2.3
1010
github.com/coreos/go-iptables v0.8.0
1111
github.com/coreos/go-systemd/v22 v22.5.0
12-
github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c
13-
github.com/d2g/dhcp4client v1.0.0
14-
github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5
1512
github.com/godbus/dbus/v5 v5.1.0
13+
github.com/insomniacslk/dhcp v0.0.0-20240829085014-a3a4c1f04475
1614
github.com/mattn/go-shellwords v1.0.12
1715
github.com/networkplumbing/go-nft v0.4.0
1816
github.com/onsi/ginkgo/v2 v2.20.2
@@ -28,17 +26,22 @@ require (
2826
github.com/Microsoft/go-winio v0.6.2 // indirect
2927
github.com/containerd/cgroups/v3 v3.0.3 // indirect
3028
github.com/containerd/errdefs v0.1.0 // indirect
31-
github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4 // indirect
3229
github.com/go-logr/logr v1.4.2 // indirect
3330
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
3431
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3532
github.com/google/go-cmp v0.6.0 // indirect
3633
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
34+
github.com/josharian/native v1.1.0 // indirect
35+
github.com/mdlayher/packet v1.1.2 // indirect
36+
github.com/mdlayher/socket v0.5.1 // indirect
37+
github.com/pierrec/lz4/v4 v4.1.21 // indirect
3738
github.com/pkg/errors v0.9.1 // indirect
3839
github.com/sirupsen/logrus v1.9.3 // indirect
40+
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect
3941
github.com/vishvananda/netns v0.0.4 // indirect
4042
go.opencensus.io v0.24.0 // indirect
4143
golang.org/x/net v0.28.0 // indirect
44+
golang.org/x/sync v0.8.0 // indirect
4245
golang.org/x/text v0.17.0 // indirect
4346
golang.org/x/tools v0.24.0 // indirect
4447
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect

go.sum

+16-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ github.com/coreos/go-iptables v0.8.0 h1:MPc2P89IhuVpLI7ETL/2tx3XZ61VeICZjYqDEgNs
2121
github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q=
2222
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
2323
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
24-
github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c h1:Xo2rK1pzOm0jO6abTPIQwbAmqBIOj132otexc1mmzFc=
25-
github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ=
26-
github.com/d2g/dhcp4client v1.0.0 h1:suYBsYZIkSlUMEz4TAYCczKf62IA2UWC+O8+KtdOhCo=
27-
github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s=
28-
github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5 h1:+CpLbZIeUn94m02LdEKPcgErLJ347NUwxPKs5u8ieiY=
29-
github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8=
30-
github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4 h1:itqmmf1PFpC4n5JW+j4BU7X4MTfVurhYRTjODoPb2Y8=
31-
github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I=
3224
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3325
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3426
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -68,10 +60,20 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
6860
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
6961
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
7062
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
63+
github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 h1:/jC7qQFrv8CrSJVmaolDVOxTfS9kc36uB6H40kdbQq8=
64+
github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714/go.mod h1:2Goc3h8EklBH5mspfHFxBnEoURQCGzQQH1ga9Myjvis=
65+
github.com/insomniacslk/dhcp v0.0.0-20240829085014-a3a4c1f04475 h1:hxST5pwMBEOWmxpkX20w9oZG+hXdhKmAIPQ3NGGAxas=
66+
github.com/insomniacslk/dhcp v0.0.0-20240829085014-a3a4c1f04475/go.mod h1:KclMyHxX06VrVr0DJmeFSUb1ankt7xTfoOA35pCkoic=
67+
github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=
68+
github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
7169
github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY=
7270
github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
7371
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
7472
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
73+
github.com/mdlayher/packet v1.1.2 h1:3Up1NG6LZrsgDVn6X4L9Ge/iyRyxFEFD9o6Pr3Q1nQY=
74+
github.com/mdlayher/packet v1.1.2/go.mod h1:GEu1+n9sG5VtiRE4SydOmX5GTwyyYlteZiFU+x0kew4=
75+
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
76+
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
7577
github.com/networkplumbing/go-nft v0.4.0 h1:kExVMwXW48DOAukkBwyI16h4uhE5lN9iMvQd52lpTyU=
7678
github.com/networkplumbing/go-nft v0.4.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs=
7779
github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4=
@@ -80,6 +82,8 @@ github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
8082
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
8183
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
8284
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
85+
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
86+
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
8387
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8488
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8589
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -99,6 +103,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
99103
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
100104
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
101105
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
106+
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 h1:pyC9PaHYZFgEKFdlp3G8RaCKgVpHZnecvArXvPXcFkM=
107+
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701/go.mod h1:P3a5rG4X7tI17Nn3aOIAYr5HbIMukwXG0urG0WuL8OA=
102108
github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk=
103109
github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
104110
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
@@ -129,6 +135,8 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
129135
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
130136
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
131137
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
138+
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
139+
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
132140
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
133141
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
134142
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

plugins/ipam/dhcp/client.go

-135
This file was deleted.

plugins/ipam/dhcp/daemon.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (d *DHCP) Allocate(args *skel.CmdArgs, result *current.Result) error {
7474
return fmt.Errorf("error parsing netconf: %v", err)
7575
}
7676

77-
optsRequesting, optsProviding, err := prepareOptions(args.Args, conf.IPAM.ProvideOptions, conf.IPAM.RequestOptions)
77+
opts, err := prepareOptions(args.Args, conf.IPAM.ProvideOptions, conf.IPAM.RequestOptions)
7878
if err != nil {
7979
return err
8080
}
@@ -89,7 +89,7 @@ func (d *DHCP) Allocate(args *skel.CmdArgs, result *current.Result) error {
8989
} else {
9090
hostNetns := d.hostNetnsPrefix + args.Netns
9191
l, err = AcquireLease(clientID, hostNetns, args.IfName,
92-
optsRequesting, optsProviding,
92+
opts,
9393
d.clientTimeout, d.clientResendMax, d.broadcast)
9494
if err != nil {
9595
return err

plugins/ipam/dhcp/dhcp2_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ var _ = Describe("DHCP Multiple Lease Operations", func() {
6161
})
6262

6363
// Start the DHCP server
64-
dhcpServerDone, err = dhcpServerStart(originalNS, 2, dhcpServerStopCh)
65-
Expect(err).NotTo(HaveOccurred())
64+
dhcpServerDone = dhcpServerStart(originalNS, 2, dhcpServerStopCh)
6665

6766
// Start the DHCP client daemon
6867
dhcpPluginPath, err := exec.LookPath("dhcp")

plugins/ipam/dhcp/dhcp_test.go

+40-33
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ import (
2525
"sync"
2626
"time"
2727

28-
"github.com/d2g/dhcp4"
29-
"github.com/d2g/dhcp4server"
30-
"github.com/d2g/dhcp4server/leasepool"
31-
"github.com/d2g/dhcp4server/leasepool/memorypool"
3228
. "github.com/onsi/ginkgo/v2"
3329
. "github.com/onsi/gomega"
3430
"github.com/vishvananda/netlink"
@@ -48,31 +44,43 @@ func getTmpDir() (string, error) {
4844
return tmpDir, err
4945
}
5046

51-
func dhcpServerStart(netns ns.NetNS, numLeases int, stopCh <-chan bool) (*sync.WaitGroup, error) {
52-
// Add the expected IP to the pool
53-
lp := memorypool.MemoryPool{}
47+
type DhcpServer struct {
48+
cmd *exec.Cmd
5449

55-
Expect(numLeases).To(BeNumerically(">", 0))
56-
// Currently tests only need at most 2
57-
Expect(numLeases).To(BeNumerically("<=", 2))
50+
startAddr net.IP
51+
endAddr net.IP
52+
leaseTime time.Duration
53+
}
5854

59-
// tests expect first lease to be at address 192.168.1.5
60-
for i := 5; i < numLeases+5; i++ {
61-
err := lp.AddLease(leasepool.Lease{IP: dhcp4.IPAdd(net.IPv4(192, 168, 1, byte(i)), 0)})
62-
if err != nil {
63-
return nil, fmt.Errorf("error adding IP to DHCP pool: %v", err)
64-
}
55+
func (s *DhcpServer) Serve() error {
56+
s.cmd = exec.Command(
57+
"dnsmasq",
58+
"--no-daemon",
59+
"--dhcp-sequential-ip", // allocate IPs sequentially
60+
"--port=0", // disable DNS
61+
"--conf-file=-", // Do not read /etc/dnsmasq.conf
62+
fmt.Sprintf("--dhcp-range=%s,%s,%d", s.startAddr, s.endAddr, int(s.leaseTime.Seconds())),
63+
)
64+
s.cmd.Stdin = bytes.NewBufferString("")
65+
s.cmd.Stdout = os.Stdout
66+
s.cmd.Stderr = os.Stderr
67+
68+
return s.cmd.Start()
69+
}
70+
71+
func (s *DhcpServer) Stop() error {
72+
if err := s.cmd.Process.Kill(); err != nil {
73+
return err
6574
}
75+
_, err := s.cmd.Process.Wait()
76+
return err
77+
}
6678

67-
dhcpServer, err := dhcp4server.New(
68-
net.IPv4(192, 168, 1, 1),
69-
&lp,
70-
dhcp4server.SetLocalAddr(net.UDPAddr{IP: net.IPv4(0, 0, 0, 0), Port: 67}),
71-
dhcp4server.SetRemoteAddr(net.UDPAddr{IP: net.IPv4bcast, Port: 68}),
72-
dhcp4server.LeaseDuration(time.Minute*15),
73-
)
74-
if err != nil {
75-
return nil, fmt.Errorf("failed to create DHCP server: %v", err)
79+
func dhcpServerStart(netns ns.NetNS, numLeases int, stopCh <-chan bool) *sync.WaitGroup {
80+
dhcpServer := &DhcpServer{
81+
startAddr: net.IPv4(192, 168, 1, 5),
82+
endAddr: net.IPv4(192, 168, 1, 5+uint8(numLeases)-1),
83+
leaseTime: 5 * time.Minute,
7684
}
7785

7886
stopWg := sync.WaitGroup{}
@@ -84,9 +92,10 @@ func dhcpServerStart(netns ns.NetNS, numLeases int, stopCh <-chan bool) (*sync.W
8492
go func() {
8593
defer GinkgoRecover()
8694

87-
err = netns.Do(func(ns.NetNS) error {
95+
err := netns.Do(func(ns.NetNS) error {
8896
startWg.Done()
89-
if err := dhcpServer.ListenAndServe(); err != nil {
97+
98+
if err := dhcpServer.Serve(); err != nil {
9099
// Log, but don't trap errors; the server will
91100
// always report an error when stopped
92101
GinkgoT().Logf("DHCP server finished with error: %v", err)
@@ -103,12 +112,12 @@ func dhcpServerStart(netns ns.NetNS, numLeases int, stopCh <-chan bool) (*sync.W
103112
go func() {
104113
startWg.Done()
105114
<-stopCh
106-
dhcpServer.Shutdown()
115+
dhcpServer.Stop()
107116
stopWg.Done()
108117
}()
109118
startWg.Wait()
110119

111-
return &stopWg, nil
120+
return &stopWg
112121
}
113122

114123
const (
@@ -200,8 +209,7 @@ var _ = Describe("DHCP Operations", func() {
200209
})
201210

202211
// Start the DHCP server
203-
dhcpServerDone, err = dhcpServerStart(originalNS, 1, dhcpServerStopCh)
204-
Expect(err).NotTo(HaveOccurred())
212+
dhcpServerDone = dhcpServerStart(originalNS, 1, dhcpServerStopCh)
205213

206214
// Start the DHCP client daemon
207215
dhcpPluginPath, err := exec.LookPath("dhcp")
@@ -517,8 +525,7 @@ var _ = Describe("DHCP Lease Unavailable Operations", func() {
517525
})
518526

519527
// Start the DHCP server
520-
dhcpServerDone, err = dhcpServerStart(originalNS, 1, dhcpServerStopCh)
521-
Expect(err).NotTo(HaveOccurred())
528+
dhcpServerDone = dhcpServerStart(originalNS, 1, dhcpServerStopCh)
522529

523530
// Start the DHCP client daemon
524531
dhcpPluginPath, err := exec.LookPath("dhcp")

0 commit comments

Comments
 (0)