pull request for net: batman-adv 2017-06-13
Subsystems (3)
cover pull request for net: batman-adv 2017-06-13
Hi David,
here are two batman-adv bugfixes for net.
Please pull or let me know of any problem!
Thank you,
Simon
The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batadv-net-for-davem-20170613
for you to fetch changes up to a1a745ef980a1b48299ead4ea7990e62c0516f6e:
batman-adv: fix memory leak when dropping packet from other gateway (2017-05-19 12:20:28 +0200)
----------------------------------------------------------------
Here are two batman-adv bugfixes:
- fix rx packet counters for local ARP replies, by Sven Eckelmann
- fix memory leaks for unicast packetes received from another gateway in bridge loop avoidance, by Andreas Pape
----------------------------------------------------------------
Andreas Pape (1):
batman-adv: fix memory leak when dropping packet from other gateway
Sven Eckelmann (1):
batman-adv: Fix rx packet/bytes stats on local ARP reply
net/batman-adv/distributed-arp-table.c | 5 +++-- net/batman-adv/routing.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
A message that is not in the archive (sent off-list or not yet received): 20170613111531.29082-1-sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org
PATCH 1/2 batman-adv: Fix rx packet/bytes stats on local ARP reply
From: Sven Eckelmann <[email protected]>
The stats are generated by batadv_interface_stats and must not be stored directly in the net_device stats member variable. The batadv_priv bat_counters information is assembled when ndo_get_stats is called. The stats previously stored in net_device::stats is then overwritten.
The batman-adv counters must therefore be increased when an ARP packet is answered locally via the distributed arp table.
--- net/batman-adv/distributed-arp-table.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/batman-adv/distributed-arp-table.c +3 -2
@@ -1064,8 +1064,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, skb_new->protocol =eth_type_trans (skb_new, soft_iface); - soft_iface->stats.rx_packets++; - soft_iface->stats.rx_bytes += skb->len +ETH_HLEN + hdr_size; +batadv_inc_counter (bat_priv,BATADV_CNT_RX ); +batadv_add_counter (bat_priv,BATADV_CNT_RX_BYTES , + skb->len +ETH_HLEN + hdr_size);netif_rx (skb_new);batadv_dbg (BATADV_DBG_DAT , bat_priv,"ARP request replied locally\n" );
Signature · 1 line
2.11.0
PATCH 2/2 batman-adv: fix memory leak when dropping packet from other gateway
In reply to a message not in the archiveFrom: Andreas Pape <[email protected]>
The skb must be released in the receive handler since b91a2543b4c1 ("batman-adv: Consume skb in receive handlers"). Just returning NET_RX_DROP will no longer automatically free the memory. This results in memory leaks when unicast packets from other backbones must be dropped because they share a common backbone.
--- net/batman-adv/routing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/routing.c +1 -1
@@ -987,7 +987,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,batadv_dbg (BATADV_DBG_BLA , bat_priv,"recv_unicast_packet(): Dropped unicast pkt received from another backbone gw %pM.\n" , orig_addr_gw); -return NET_RX_DROP ; + goto free_skb; } }
Signature · 1 line
2.11.0
David Miller
maintainerFrom: Simon Wunderlich <[email protected]>
Date: Tue, 13 Jun 2017 13:15:29 +0200
Quoted 3 lines
here are two batman-adv bugfixes for net.
Please pull or let me know of any problem!
Pulled, thanks.