aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-05 17:33:28 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-05 17:33:28 -0500
commit6e03f896b52cd2ca88942170c5c9c407ec0ede69 (patch)
tree48ca9a6efa5f99819667538838bab3679416f92c /net/core
parentdb79a621835ee91d3e10177abd97f48e0a4dcf9b (diff)
parent9d82f5eb3376cbae96ad36a063a9390de1694546 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/vxlan.c drivers/vhost/net.c include/linux/if_vlan.h net/core/dev.c The net/core/dev.c conflict was the overlap of one commit marking an existing function static whilst another was adding a new function. In the include/linux/if_vlan.h case, the type used for a local variable was changed in 'net', whereas the function got rewritten to fix a stacked vlan bug in 'net-next'. In drivers/vhost/net.c, Al Viro's iov_iter conversions in 'net-next' overlapped with an endainness fix for VHOST 1.0 in 'net'. In drivers/net/vxlan.c, vxlan_find_vni() added a 'flags' parameter in 'net-next' whereas in 'net' there was a bug fix to pass in the correct network namespace pointer in calls to this function. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c37
-rw-r--r--net/core/rtnetlink.c6
2 files changed, 9 insertions, 34 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ede0b161b115..a3a96ffc67f4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2379,7 +2379,6 @@ EXPORT_SYMBOL(skb_checksum_help);
2379 2379
2380__be16 skb_network_protocol(struct sk_buff *skb, int *depth) 2380__be16 skb_network_protocol(struct sk_buff *skb, int *depth)
2381{ 2381{
2382 unsigned int vlan_depth = skb->mac_len;
2383 __be16 type = skb->protocol; 2382 __be16 type = skb->protocol;
2384 2383
2385 /* Tunnel gso handlers can set protocol to ethernet. */ 2384 /* Tunnel gso handlers can set protocol to ethernet. */
@@ -2393,35 +2392,7 @@ __be16 skb_network_protocol(struct sk_buff *skb, int *depth)
2393 type = eth->h_proto; 2392 type = eth->h_proto;
2394 } 2393 }
2395 2394
2396 /* if skb->protocol is 802.1Q/AD then the header should already be 2395 return __vlan_get_protocol(skb, type, depth);
2397 * present at mac_len - VLAN_HLEN (if mac_len > 0), or at
2398 * ETH_HLEN otherwise
2399 */
2400 if (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) {
2401 if (vlan_depth) {
2402 if (WARN_ON(vlan_depth < VLAN_HLEN))
2403 return 0;
2404 vlan_depth -= VLAN_HLEN;
2405 } else {
2406 vlan_depth = ETH_HLEN;
2407 }
2408 do {
2409 struct vlan_hdr *vh;
2410
2411 if (unlikely(!pskb_may_pull(skb,
2412 vlan_depth + VLAN_HLEN)))
2413 return 0;
2414
2415 vh = (struct vlan_hdr *)(skb->data + vlan_depth);
2416 type = vh->h_vlan_encapsulated_proto;
2417 vlan_depth += VLAN_HLEN;
2418 } while (type == htons(ETH_P_8021Q) ||
2419 type == htons(ETH_P_8021AD));
2420 }
2421
2422 *depth = vlan_depth;
2423
2424 return type;
2425} 2396}
2426 2397
2427/** 2398/**
@@ -5375,7 +5346,7 @@ void netdev_bonding_info_change(struct net_device *dev,
5375} 5346}
5376EXPORT_SYMBOL(netdev_bonding_info_change); 5347EXPORT_SYMBOL(netdev_bonding_info_change);
5377 5348
5378void netdev_adjacent_add_links(struct net_device *dev) 5349static void netdev_adjacent_add_links(struct net_device *dev)
5379{ 5350{
5380 struct netdev_adjacent *iter; 5351 struct netdev_adjacent *iter;
5381 5352
@@ -5400,7 +5371,7 @@ void netdev_adjacent_add_links(struct net_device *dev)
5400 } 5371 }
5401} 5372}
5402 5373
5403void netdev_adjacent_del_links(struct net_device *dev) 5374static void netdev_adjacent_del_links(struct net_device *dev)
5404{ 5375{
5405 struct netdev_adjacent *iter; 5376 struct netdev_adjacent *iter;
5406 5377
@@ -6713,7 +6684,7 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
6713 if (!queue) 6684 if (!queue)
6714 return NULL; 6685 return NULL;
6715 netdev_init_one_queue(dev, queue, NULL); 6686 netdev_init_one_queue(dev, queue, NULL);
6716 queue->qdisc = &noop_qdisc; 6687 RCU_INIT_POINTER(queue->qdisc, &noop_qdisc);
6717 queue->qdisc_sleeping = &noop_qdisc; 6688 queue->qdisc_sleeping = &noop_qdisc;
6718 rcu_assign_pointer(dev->ingress_queue, queue); 6689 rcu_assign_pointer(dev->ingress_queue, queue);
6719#endif 6690#endif
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4cd5e350d129..5dad4f782f03 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2937,12 +2937,16 @@ static int rtnl_bridge_notify(struct net_device *dev)
2937 if (err < 0) 2937 if (err < 0)
2938 goto errout; 2938 goto errout;
2939 2939
2940 if (!skb->len)
2941 goto errout;
2942
2940 rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); 2943 rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
2941 return 0; 2944 return 0;
2942errout: 2945errout:
2943 WARN_ON(err == -EMSGSIZE); 2946 WARN_ON(err == -EMSGSIZE);
2944 kfree_skb(skb); 2947 kfree_skb(skb);
2945 rtnl_set_sk_err(net, RTNLGRP_LINK, err); 2948 if (err)
2949 rtnl_set_sk_err(net, RTNLGRP_LINK, err);
2946 return err; 2950 return err;
2947} 2951}
2948 2952