NetworkManager/shared
Beniamino Galvani bee01292f8 n-dhcp4: don't fail dispatch in case of receive errors
Currently any error encountered in n_dhcp4_c_connection_dispatch_io()
causes a dispatch failure and interrupts the library state
machine. The recvmsg() on the socket can fail for different reasons;
one of these is for example that the UDP request previously sent got a
ICMP port-unreachable response. This can be reproduced in the
following way:

 ip netns add ns1
 ip link add veth0 type veth peer name veth1
 ip link set veth1 netns ns1
 ip link set veth0 up

 cat > dhcpd.conf <<EOF
 server-identifier 172.25.0.1;
 max-lease-time 120;
 default-lease-time 120;
 subnet 172.25.0.0 netmask 255.255.255.0 {
        range 172.25.0.100 172.25.0.200;
 }
 EOF

 ip -n ns1 link set veth1 up
 ip -n ns1 address add dev veth1 172.25.0.1/24
 ip netns exec ns1 iptables -A INPUT -p udp --dport 67 -j REJECT
 ip netns exec ns1 dhcpd -4 -cf dhcpd.conf -pf /tmp/dhcp-server.pid

If a client is started on veth0, it is able to obtain a lease despite
the firewall rule blocking DHCP, because dhcpd uses a packet
socket. Then it fails during the renewal because the recvmsg() fails:

 dhcp4 (veth0): send REQUEST of 172.25.0.178 to 172.25.0.1
 dhcp4 (veth0): error -111 dispatching events
 dhcp4 (veth0): state changed bound -> fail

The client should consider such errors non fatal and keep running.

https://bugzilla.redhat.com/show_bug.cgi?id=1829178
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/486
(cherry picked from commit c5d1d4c498)
2020-04-30 18:15:42 +02:00
..
c-list license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
c-rbtree license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
c-siphash license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
c-stdaux license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
n-acd license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
n-dhcp4 n-dhcp4: don't fail dispatch in case of receive errors 2020-04-30 18:15:42 +02:00
nm-glib-aux shared/glib: prevent users to use g_cancellable_reset() 2020-04-29 12:29:55 +02:00
nm-keyfile keyfile: minor cleanup handling error in read_array_of_uint() 2020-04-15 22:41:02 +02:00
nm-libnm-aux clients: in debug builds randomly use sync init of NMClient for testing 2019-12-10 09:17:17 +01:00
nm-libnm-core-aux all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-libnm-core-intern shared: expose size of nm_ethtool_data array in header 2020-03-06 09:49:32 +01:00
nm-std-aux license: relicense "shared/nm-std-aux/nm-dbus-compat.h" under LGPL-2.1+ 2020-01-14 16:54:43 +01:00
nm-udev-aux shared/udev: don't use GIOChannel to watch plain file descriptor 2020-01-13 15:46:04 +01:00
nm-utils nm-setting-bridge: add 'group-address' bridge option 2020-04-06 09:56:11 +02:00
systemd systemd: merge branch systemd into master 2020-04-08 09:08:49 +02:00
meson.build systemd: merge branch systemd into master 2020-04-08 09:08:49 +02:00
nm-default.h libnm: include "nm-libnm-utils.h" by default in libnm sources 2019-10-18 22:09:18 +02:00
nm-meta-setting.c libnm-core,cli: add VRF setting 2020-01-14 09:49:01 +01:00
nm-meta-setting.h libnm-core,cli: add VRF setting 2020-01-14 09:49:01 +01:00
nm-test-libnm-utils.h libnm/tests: extend nmtstc_client_new() to create other GObject types 2020-01-28 10:54:14 +01:00
nm-test-utils-impl.c libnm/tests: cleanup add_device_common() test helper 2020-01-28 10:54:14 +01:00
nm-version-macros.h.in release: bump version to 1.23.0 (development) 2019-11-29 15:46:22 +01:00