1
0
Fork 0
remarkable-linux/net/batman-adv
Linus Lüssing cbecd7187c batman-adv: fix packet loss for broadcasted DHCP packets to a server
[ Upstream commit a752c0a452 ]

DHCP connectivity issues can currently occur if the following conditions
are met:

1) A DHCP packet from a client to a server
2) This packet has a multicast destination
3) This destination has a matching entry in the translation table
   (FF:FF:FF:FF:FF:FF for IPv4, 33:33:00:01:00:02/33:33:00:01:00:03
    for IPv6)
4) The orig-node determined by TT for the multicast destination
   does not match the orig-node determined by best-gateway-selection

In this case the DHCP packet will be dropped.

The "gateway-out-of-range" check is supposed to only be applied to
unicasted DHCP packets to a specific DHCP server.

In that case dropping the the unicasted frame forces the client to
retry via a broadcasted one, but now directed to the new best
gateway.

A DHCP packet with broadcast/multicast destination is already ensured to
always be delivered to the best gateway. Dropping a multicasted
DHCP packet here will only prevent completing DHCP as there is no
other fallback.

So far, it seems the unicast check was implicitly performed by
expecting the batadv_transtable_search() to return NULL for multicast
destinations. However, a multicast address could have always ended up in
the translation table and in fact is now common.

To fix this potential loss of a DHCP client-to-server packet to a
multicast address this patch adds an explicit multicast destination
check to reliably bail out of the gateway-out-of-range check for such
destinations.

The issue and fix were tested in the following three node setup:

- Line topology, A-B-C
- A: gateway client, DHCP client
- B: gateway server, hop-penalty increased: 30->60, DHCP server
- C: gateway server, code modifications to announce FF:FF:FF:FF:FF:FF

Without this patch, A would never transmit its DHCP Discover packet
due to an always "out-of-range" condition. With this patch,
a full DHCP handshake between A and B was possible again.

Fixes: be7af5cf9c ("batman-adv: refactoring gateway handling code")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:52:19 +02:00
..
Kconfig batman-adv: Allow selecting BATMAN V if CFG80211 is not built 2016-10-17 16:28:48 +02:00
Makefile batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bat_algo.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bat_algo.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bat_iv_ogm.c batman-adv: Ignore invalid batadv_iv_gw during netlink send 2018-05-30 07:52:04 +02:00
bat_iv_ogm.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bat_v.c batman-adv: Ignore invalid batadv_v_gw during netlink send 2018-05-30 07:52:04 +02:00
bat_v.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bat_v_elp.c networking: convert many more places to skb_put_zero() 2017-06-16 11:48:35 -04:00
bat_v_elp.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bat_v_ogm.c batman-adv: fix various spelling mistakes 2017-07-29 09:51:28 +02:00
bat_v_ogm.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bitarray.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bitarray.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
bridge_loop_avoidance.c batman-adv: Fix netlink dumping of BLA backbones 2018-05-30 07:52:04 +02:00
bridge_loop_avoidance.h batman-adv: prevent multiple ARP replies sent by gateways if dat enabled 2017-03-22 10:30:53 +01:00
debugfs.c batman-adv: Fix includes for IS_ERR/ERR_PTR 2017-01-28 10:40:35 +01:00
debugfs.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
distributed-arp-table.c batman-adv: fix header size check in batadv_dbg_arp() 2018-05-30 07:52:16 +02:00
distributed-arp-table.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
fragmentation.c batman-adv: invalidate checksum on fragment reassembly 2018-05-30 07:52:03 +02:00
fragmentation.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
gateway_client.c batman-adv: fix packet loss for broadcasted DHCP packets to a server 2018-05-30 07:52:19 +02:00
gateway_client.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
gateway_common.c Here are two batman-adv bugfixes: 2017-03-16 12:05:38 -07:00
gateway_common.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
hard-interface.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
hard-interface.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
hash.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
hash.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
icmp_socket.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
icmp_socket.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
log.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
log.h batman-adv: Fix possible side-effects in _batadv_dbg 2017-03-16 21:14:52 +01:00
main.c batman-adv: restructure rebroadcast counter into forw_packet API 2017-03-26 12:46:44 +02:00
main.h batman-adv: Start new development cycle 2017-07-29 09:51:25 +02:00
multicast.c batman-adv: fix multicast-via-unicast transmission with AP isolation 2018-05-30 07:52:19 +02:00
multicast.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
netlink.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
netlink.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
network-coding.c batman-adv: Combine two seq_puts() calls into one call in batadv_nc_nodes_seq_print_text() 2017-05-23 12:09:15 +02:00
network-coding.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
originator.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
originator.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
packet.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
routing.c batman-adv: Fix skbuff rcsum on packet reroute 2018-05-30 07:52:16 +02:00
routing.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
send.c batman-adv: fix various spelling mistakes 2017-07-29 09:51:28 +02:00
send.h batman-adv: restructure rebroadcast counter into forw_packet API 2017-03-26 12:46:44 +02:00
soft-interface.c batman-adv: fix packet checksum in receive path 2018-05-30 07:52:03 +02:00
soft-interface.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
sysfs.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
sysfs.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
tp_meter.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
tp_meter.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
translation-table.c batman-adv: fix TT sync flag inconsistencies 2017-07-31 11:17:38 +02:00
translation-table.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
tvlv.c batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
tvlv.h batman-adv: update copyright years for 2017 2017-01-26 08:34:19 +01:00
types.h batman-adv: fix TT sync flag inconsistencies 2017-07-31 11:17:38 +02:00