diff options
-rw-r--r-- | drivers/net/macvlan.c | 2 | ||||
-rw-r--r-- | include/linux/netdevice.h | 9 | ||||
-rw-r--r-- | net/8021q/vlan_dev.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 36 |
4 files changed, 7 insertions, 42 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index f975afdc315c..025367a94add 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -259,7 +259,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) | |||
259 | 259 | ||
260 | xmit_world: | 260 | xmit_world: |
261 | skb->ip_summed = ip_summed; | 261 | skb->ip_summed = ip_summed; |
262 | skb_set_dev(skb, vlan->lowerdev); | 262 | skb->dev = vlan->lowerdev; |
263 | return dev_queue_xmit(skb); | 263 | return dev_queue_xmit(skb); |
264 | } | 264 | } |
265 | 265 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5cbaa20f1659..33900a53c990 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1403,15 +1403,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
1403 | return 0; | 1403 | return 0; |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | #ifndef CONFIG_NET_NS | ||
1407 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
1408 | { | ||
1409 | skb->dev = dev; | ||
1410 | } | ||
1411 | #else /* CONFIG_NET_NS */ | ||
1412 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
1413 | #endif | ||
1414 | |||
1415 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1406 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
1416 | { | 1407 | { |
1417 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1408 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 9988d4abb372..9757c193c86b 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -157,7 +157,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, | |||
157 | skb = __vlan_hwaccel_put_tag(skb, vlan_tci); | 157 | skb = __vlan_hwaccel_put_tag(skb, vlan_tci); |
158 | } | 158 | } |
159 | 159 | ||
160 | skb_set_dev(skb, vlan_dev_priv(dev)->real_dev); | 160 | skb->dev = vlan_dev_priv(dev)->real_dev; |
161 | len = skb->len; | 161 | len = skb->len; |
162 | if (netpoll_tx_running(dev)) | 162 | if (netpoll_tx_running(dev)) |
163 | return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev); | 163 | return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev); |
diff --git a/net/core/dev.c b/net/core/dev.c index 9bb8f87c4cda..99e1d759f41e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1617,10 +1617,14 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | |||
1617 | return NET_RX_DROP; | 1617 | return NET_RX_DROP; |
1618 | } | 1618 | } |
1619 | skb->skb_iif = 0; | 1619 | skb->skb_iif = 0; |
1620 | skb_set_dev(skb, dev); | 1620 | skb->dev = dev; |
1621 | skb_dst_drop(skb); | ||
1621 | skb->tstamp.tv64 = 0; | 1622 | skb->tstamp.tv64 = 0; |
1622 | skb->pkt_type = PACKET_HOST; | 1623 | skb->pkt_type = PACKET_HOST; |
1623 | skb->protocol = eth_type_trans(skb, dev); | 1624 | skb->protocol = eth_type_trans(skb, dev); |
1625 | skb->mark = 0; | ||
1626 | secpath_reset(skb); | ||
1627 | nf_reset(skb); | ||
1624 | return netif_rx(skb); | 1628 | return netif_rx(skb); |
1625 | } | 1629 | } |
1626 | EXPORT_SYMBOL_GPL(dev_forward_skb); | 1630 | EXPORT_SYMBOL_GPL(dev_forward_skb); |
@@ -1869,36 +1873,6 @@ void netif_device_attach(struct net_device *dev) | |||
1869 | } | 1873 | } |
1870 | EXPORT_SYMBOL(netif_device_attach); | 1874 | EXPORT_SYMBOL(netif_device_attach); |
1871 | 1875 | ||
1872 | /** | ||
1873 | * skb_dev_set -- assign a new device to a buffer | ||
1874 | * @skb: buffer for the new device | ||
1875 | * @dev: network device | ||
1876 | * | ||
1877 | * If an skb is owned by a device already, we have to reset | ||
1878 | * all data private to the namespace a device belongs to | ||
1879 | * before assigning it a new device. | ||
1880 | */ | ||
1881 | #ifdef CONFIG_NET_NS | ||
1882 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
1883 | { | ||
1884 | skb_dst_drop(skb); | ||
1885 | if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) { | ||
1886 | secpath_reset(skb); | ||
1887 | nf_reset(skb); | ||
1888 | skb_init_secmark(skb); | ||
1889 | skb->mark = 0; | ||
1890 | skb->priority = 0; | ||
1891 | skb->nf_trace = 0; | ||
1892 | skb->ipvs_property = 0; | ||
1893 | #ifdef CONFIG_NET_SCHED | ||
1894 | skb->tc_index = 0; | ||
1895 | #endif | ||
1896 | } | ||
1897 | skb->dev = dev; | ||
1898 | } | ||
1899 | EXPORT_SYMBOL(skb_set_dev); | ||
1900 | #endif /* CONFIG_NET_NS */ | ||
1901 | |||
1902 | static void skb_warn_bad_offload(const struct sk_buff *skb) | 1876 | static void skb_warn_bad_offload(const struct sk_buff *skb) |
1903 | { | 1877 | { |
1904 | static const netdev_features_t null_features = 0; | 1878 | static const netdev_features_t null_features = 0; |