Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[sfrench/cifs-2.6.git] / drivers / net / bonding / bond_main.c
index 091e035c76a6ff29facbaf1c0f26d185dc8ff5e3..7a0f25301f7ec25f471cb74b856342dfdbefd21d 100644 (file)
@@ -1,8 +1,9 @@
+// SPDX-License-Identifier: GPL-1.0+
 /*
  * originally based on the dummy device.
  *
  * Copyright 1999, Thomas Davis, tadavis@lbl.gov.
- * Licensed under the GPL. Based on dummy.c, and eql.c devices.
+ * Based on dummy.c, and eql.c devices.
  *
  * bonding.c: an Ethernet Bonding driver
  *
@@ -2871,6 +2872,8 @@ static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
        return ret;
 }
 
+#define BOND_VLAN_PROTO_NONE cpu_to_be16(0xffff)
+
 static bool bond_handle_vlan(struct slave *slave, struct bond_vlan_tag *tags,
                             struct sk_buff *skb)
 {
@@ -2878,13 +2881,13 @@ static bool bond_handle_vlan(struct slave *slave, struct bond_vlan_tag *tags,
        struct net_device *slave_dev = slave->dev;
        struct bond_vlan_tag *outer_tag = tags;
 
-       if (!tags || tags->vlan_proto == VLAN_N_VID)
+       if (!tags || tags->vlan_proto == BOND_VLAN_PROTO_NONE)
                return true;
 
        tags++;
 
        /* Go through all the tags backwards and add them to the packet */
-       while (tags->vlan_proto != VLAN_N_VID) {
+       while (tags->vlan_proto != BOND_VLAN_PROTO_NONE) {
                if (!tags->vlan_id) {
                        tags++;
                        continue;
@@ -2960,7 +2963,7 @@ struct bond_vlan_tag *bond_verify_device_path(struct net_device *start_dev,
                tags = kcalloc(level + 1, sizeof(*tags), GFP_ATOMIC);
                if (!tags)
                        return ERR_PTR(-ENOMEM);
-               tags[level].vlan_proto = VLAN_N_VID;
+               tags[level].vlan_proto = BOND_VLAN_PROTO_NONE;
                return tags;
        }
 
@@ -5439,7 +5442,7 @@ static netdev_tx_t bond_tls_device_xmit(struct bonding *bond, struct sk_buff *sk
 {
        struct net_device *tls_netdev = rcu_dereference(tls_get_ctx(skb->sk)->netdev);
 
-       /* tls_netdev might become NULL, even if tls_is_sk_tx_device_offloaded
+       /* tls_netdev might become NULL, even if tls_is_skb_tx_device_offloaded
         * was true, if tls_device_down is running in parallel, but it's OK,
         * because bond_get_slave_by_dev has a NULL check.
         */
@@ -5458,7 +5461,7 @@ static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev
                return NETDEV_TX_OK;
 
 #if IS_ENABLED(CONFIG_TLS_DEVICE)
-       if (skb->sk && tls_is_sk_tx_device_offloaded(skb->sk))
+       if (tls_is_skb_tx_device_offloaded(skb))
                return bond_tls_device_xmit(bond, skb, dev);
 #endif