On Saturday, 19 January 2019 07.14.22 CET Linus Lüssing wrote: [...]
ret = batadv_send_skb_unicast(bat_priv, newskb,
BATADV_UNICAST, 0,
orig_entry->orig_node, vid);
if (ret != NET_XMIT_SUCCESS) {
/* use kfree_skb() to signalize losses here, but keep
* trying other destinations
*/
kfree_skb(newskb);
ret = NET_XMIT_SUCCESS;
}
[...]
ret = batadv_send_skb_unicast(bat_priv, newskb,
BATADV_UNICAST, 0,
orig_node, vid);
if (ret != NET_XMIT_SUCCESS) {
/* use kfree_skb() to signalize losses here, but keep
* trying other destinations
*/
kfree_skb(newskb);
ret = NET_XMIT_SUCCESS;
}
As you already wrote in your other messages - the send skb send functions (like also in other parts of the kernel) consume the skb. The caller must therefore not free the skb again.
Which also means that you should rewrite the patch to behave the same and not leak skbs. You most likely already partially do this this in [1]. But we have to check this in detail in the new version.
One point where it looks "wrong" (I've seen the comment) is batadv_mcast_forw_want_all_send -> default case. Not sure what to do about batadv_mcast_forw_tt_send + batadv_mcast_forw_want_all_send which follow after each other in batadv_mcast_forw_send. Even when the function should have consumed the actual skb.
Kind regards, Sven
[1] https://github.com/freifunk-gluon/gluon/pull/1357/commits/a973442fc9efd28a8b...