From: Simon Wunderlich <sw@simonwunderlich.de> Date: 2017-01-26 16:44:15
From: Simon Wunderlich <redacted>
The bridge loop avoidance (BLA) feature of batman-adv sends packets to
probe for Mesh/LAN packet loops. Those packets are not sent by real
clients and should therefore not be added to the translation table (TT).
Signed-off-by: Simon Wunderlich <redacted>
---
net/batman-adv/bridge_loop_avoidance.h | 18 ++++++++++++++++++
net/batman-adv/soft-interface.c | 3 ++-
2 files changed, 20 insertions(+), 1 deletion(-)
@@ -258,7 +258,8 @@ static int batadv_interface_tx(struct sk_buff *skb,ethhdr=eth_hdr(skb);/* Register the client MAC in the transtable */-if(!is_multicast_ether_addr(ethhdr->h_source)){+if(!is_multicast_ether_addr(ethhdr->h_source)&&+!batadv_bla_is_loopdetect_mac(ethhdr->h_source)){client_added=batadv_tt_local_add(soft_iface,ethhdr->h_source,vid,skb->skb_iif,skb->mark);
From: Simon Wunderlich <sw@simonwunderlich.de> Date: 2017-01-26 16:44:15
From: Sven Eckelmann <sven@narfation.org>
09748a22f4ab ("batman-adv: add generic netlink family for batman-adv")
introduced the new batman_adv.h which describes the netlink attributes and
commands of batman-adv. But the Kbuild entry to install the header was not
added.
All currently known tools ship their own copy of batman_adv.h but it should
be installed anyway to later be able to migrate to the system batman_adv.h.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
include/uapi/linux/Kbuild | 1 +
1 file changed, 1 insertion(+)
From: Simon Wunderlich <sw@simonwunderlich.de> Date: 2017-01-26 16:44:17
From: Gao Feng <redacted>
The tc could return NET_XMIT_CN as one congestion notification, but
it does not mean the packet is lost. Other modules like ipvlan,
macvlan, and others treat NET_XMIT_CN as success too.
So batman-adv should handle NET_XMIT_CN also as NET_XMIT_SUCCESS.
Signed-off-by: Gao Feng <redacted>
[sven@narfation.org: Moved NET_XMIT_CN handling to batadv_send_skb_packet]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
net/batman-adv/send.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Simon Wunderlich <sw@simonwunderlich.de> Date: 2017-01-26 16:44:17
From: Gao Feng <redacted>
It could decrease one condition check to collect some statements in the
first condition block.
Signed-off-by: Gao Feng <redacted>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
net/batman-adv/routing.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
@@ -719,20 +719,19 @@ static int batadv_route_unicast_packet(struct sk_buff *skb,len=skb->len;res=batadv_send_skb_to_orig(skb,orig_node,recv_if);-if(res==NET_XMIT_SUCCESS)-ret=NET_RX_SUCCESS;--/* skb was consumed */-skb=NULL;/* translate transmit result into receive result */if(res==NET_XMIT_SUCCESS){+ret=NET_RX_SUCCESS;/* skb was transmitted and consumed */batadv_inc_counter(bat_priv,BATADV_CNT_FORWARD);batadv_add_counter(bat_priv,BATADV_CNT_FORWARD_BYTES,len+ETH_HLEN);}+/* skb was consumed */+skb=NULL;+put_orig_node:batadv_orig_node_put(orig_node);free_skb: