]> exis.tech > repos - linux.git/blobdiff - net/batman-adv/main.c
Merge tag 'hwmon-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[linux.git] / net / batman-adv / main.c
index 4d3807a645b78b639c4f3d0a9cdc193cd936d050..67bed3ee77e7e72e67ce0361960620661ddbb798 100644 (file)
@@ -259,6 +259,7 @@ err_orig:
 void batadv_mesh_free(struct net_device *mesh_iface)
 {
        struct batadv_priv *bat_priv = netdev_priv(mesh_iface);
+       struct batadv_meshif_vlan *vlan;
 
        WRITE_ONCE(bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
 
@@ -273,6 +274,13 @@ void batadv_mesh_free(struct net_device *mesh_iface)
 
        batadv_mcast_free(bat_priv);
 
+       /* destroy the "untagged" VLAN */
+       vlan = batadv_meshif_vlan_get(bat_priv, BATADV_NO_FLAGS);
+       if (vlan) {
+               batadv_meshif_destroy_vlan(bat_priv, vlan);
+               batadv_meshif_vlan_put(vlan);
+       }
+
        /* Free the TT and the originator tables only after having terminated
         * all the other depending components which may use these structures for
         * their purposes.
@@ -368,7 +376,7 @@ void batadv_skb_set_priority(struct sk_buff *skb, int offset)
 
        switch (ethhdr->h_proto) {
        case htons(ETH_P_8021Q):
-               vhdr = skb_header_pointer(skb, offset + sizeof(*vhdr),
+               vhdr = skb_header_pointer(skb, offset,
                                          sizeof(*vhdr), &vhdr_tmp);
                if (!vhdr)
                        return;