aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 12:14:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 12:14:21 -0400
commit32535bd5637d3152f944f124bcc82d498892ba1b (patch)
tree99d33b58cfec44f4cf95fad5efa75aea0dd7d60b /net/core
parent0b623f871d7c993fac8ad7aaaa8f5f3cdb8ed480 (diff)
parent3a36dd068f4308461661d28e8e14e11e426eba6b (diff)
Merge branch 'v3.5-for-usb' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into usb-next
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c36
-rw-r--r--net/core/pktgen.c10
2 files changed, 13 insertions, 33 deletions
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}
1626EXPORT_SYMBOL_GPL(dev_forward_skb); 1630EXPORT_SYMBOL_GPL(dev_forward_skb);
@@ -1869,36 +1873,6 @@ void netif_device_attach(struct net_device *dev)
1869} 1873}
1870EXPORT_SYMBOL(netif_device_attach); 1874EXPORT_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
1882void 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}
1899EXPORT_SYMBOL(skb_set_dev);
1900#endif /* CONFIG_NET_NS */
1901
1902static void skb_warn_bad_offload(const struct sk_buff *skb) 1876static 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;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 4d8ce93cd503..77a59980b579 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1931,7 +1931,7 @@ static int pktgen_device_event(struct notifier_block *unused,
1931{ 1931{
1932 struct net_device *dev = ptr; 1932 struct net_device *dev = ptr;
1933 1933
1934 if (!net_eq(dev_net(dev), &init_net)) 1934 if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)
1935 return NOTIFY_DONE; 1935 return NOTIFY_DONE;
1936 1936
1937 /* It is OK that we do not hold the group lock right now, 1937 /* It is OK that we do not hold the group lock right now,
@@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void)
3755{ 3755{
3756 struct pktgen_thread *t; 3756 struct pktgen_thread *t;
3757 struct list_head *q, *n; 3757 struct list_head *q, *n;
3758 struct list_head list;
3758 3759
3759 /* Stop all interfaces & threads */ 3760 /* Stop all interfaces & threads */
3760 pktgen_exiting = true; 3761 pktgen_exiting = true;
3761 3762
3762 list_for_each_safe(q, n, &pktgen_threads) { 3763 mutex_lock(&pktgen_thread_lock);
3764 list_splice(&list, &pktgen_threads);
3765 mutex_unlock(&pktgen_thread_lock);
3766
3767 list_for_each_safe(q, n, &list) {
3763 t = list_entry(q, struct pktgen_thread, th_list); 3768 t = list_entry(q, struct pktgen_thread, th_list);
3769 list_del(&t->th_list);
3764 kthread_stop(t->tsk); 3770 kthread_stop(t->tsk);
3765 kfree(t); 3771 kfree(t);
3766 } 3772 }