diff options
author | Linus Lüssing <linus.luessing@c0d3.blue> | 2016-06-20 21:39:54 +0200 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2016-08-09 07:54:32 +0200 |
commit | a65e5481315e0754a20f58aa374423610a311f33 (patch) | |
tree | 32a59a2b19862ac384c81babaf03f3b18a7bcf47 /net/batman-adv/types.h | |
parent | 4fd261bf586b0fc932d5fd20d9b1648547b16eca (diff) | |
download | lwn-a65e5481315e0754a20f58aa374423610a311f33.tar.gz lwn-a65e5481315e0754a20f58aa374423610a311f33.zip |
batman-adv: Introduce forward packet creation helper
This patch abstracts the forward packet creation into the new function
batadv_forw_packet_alloc().
The queue counting and interface reference counters are now handled
internally within batadv_forw_packet_alloc() and its
batadv_forw_packet_free() counterpart. This should reduce the risk of
having reference/queue counting bugs again and should increase
code readibility.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r-- | net/batman-adv/types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 54710c781ca7..72806a3c40df 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@ -1375,6 +1375,7 @@ struct batadv_skb_cb { * locally generated packet * @if_outgoing: packet where the packet should be sent to, or NULL if * unspecified + * @queue_left: The queue (counter) this packet was applied to */ struct batadv_forw_packet { struct hlist_node list; @@ -1387,6 +1388,7 @@ struct batadv_forw_packet { struct delayed_work delayed_work; struct batadv_hard_iface *if_incoming; struct batadv_hard_iface *if_outgoing; + atomic_t *queue_left; }; /** |