Skip to content

n-dhcp4: introduce a max-attempts configuration option

Beniamino Galvani requested to merge bg/nettools-max-attempts into master

Currently if an error is encountered during a send() of a message, the client fails and there is no possibility of recover, since no timers are armed after a failed event dispatch. An easy way to reproduce a failure is to add a firewall rule like:

iptables -A OUTPUT -p udp --dport 67 -j REJECT

which makes the send() fail with EPERM during the renew. In such case, the client should continue (failing) until it reaches the rebind phase at T2, when it will be able to renew the lease using the packet socket.

This commit introduces a max-attempts configuration option that allows the caller to specify how many retries should be done on send failures. It also sets the default value to infinity.

#355 (closed)

Merge request reports