batman-adv: Avoid nullptr dereference in bla after vlan_insert_tag
commit 10c78f5854d361ded4736c1831948e0a5f67b932 upstream.
vlan_insert_tag can return NULL on errors. The bridge loop avoidance code
therefore has to check the return value of vlan_insert_tag for NULL before
it can safely operate on this pointer.
Fixes: 23721387c4
("batman-adv: add basic bridge loop avoidance code")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8227e1b64b
commit
e1aba83cb0
1 changed files with 4 additions and 1 deletions
|
@ -352,9 +352,12 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, u8 *mac,
|
|||
break;
|
||||
}
|
||||
|
||||
if (vid & BATADV_VLAN_HAS_TAG)
|
||||
if (vid & BATADV_VLAN_HAS_TAG) {
|
||||
skb = vlan_insert_tag(skb, htons(ETH_P_8021Q),
|
||||
vid & VLAN_VID_MASK);
|
||||
if (!skb)
|
||||
goto out;
|
||||
}
|
||||
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = eth_type_trans(skb, soft_iface);
|
||||
|
|
Loading…
Add table
Reference in a new issue