[PATCH Yakkety SRU 0/1] net: fix incorrect original ingress device index in PKTINFO

jorge.niedbalski at canonical.com jorge.niedbalski at canonical.com
Thu Apr 20 21:02:32 UTC 2017

From: Jorge Niedbalski <jorge.niedbalski at canonical.com>

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1683982


We identified a bug in one of the utilities provided by dnsmasq, the 'dhcp_release' utility which
is executed as part of the DHCP lease cleanup mechanism by Neutron once a network resource is freed.
We noticed that some packets were discarded by the DHCP server (dnsmasq) in Ubuntu systems
running a kernel >= 4.7. The reason was the ipi_ifindex field on the pktinfo was incorrectly assumed to be 1 (loopback),
this causes the message to be ignored by the dnsmasq daemon since isn't the interface on which dnsmasq is bind to.


Upstream commit:

[Test Case]

1) Configure a dnsmasq instance to server DHCP


$ sudo dnsmasq --no-hosts --no-resolv --strict-order --except-interface=lo --pid-file=/var/lib/neutron/dhcp/860b0cbb-37c3-4bcb-8345-52b942518dca/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/860b0cbb-37c3-4bcb-8345-52b942518dca/host --addn-hosts=/var/lib/neutron/dhcp/860b0cbb-37c3-4bcb-8345-52b942518dca/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/860b0cbb-37c3-4bcb-8345-52b942518dca/opts --dhcp-leasefile=/var/lib/neutron/dhcp/860b0cbb-37c3-4bcb-8345-52b942518dca/leases --dhcp-match=set:ipxe,175 --bind-interfaces --interface=ns-1cb1b7c7-c0 --dhcp-range=set:tag0,,static,86400s --dhcp-option-force=option:mtu,1458 --dhcp-lease-max=256 --conf-file=/etc/neutron/dnsmasq.conf --domain=openstacklocal

2) Boot a VM or container on the bridge/interface on which dnsmasq is bind to.
2) Use the dhcp_release utility to release the lease.

$ sudo dhcp_release ns-1cb1b7c7-c0 fa:16:3e:f3:b2:fe

The expected result: The lease is freed.
Current results: dnsmasq ignored the DHCP Release message.

Wei Zhang (1):
  net: fix incorrect original ingress device index in PKTINFO

 net/ipv4/ip_sockglue.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


More information about the kernel-team mailing list