summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 21:23:43 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 21:23:43 +0400
commitea44083a7081ac8d9cc84d49525e6041025a7a17 (patch)
treed2ff5f2d3ea257a3386cfcf7073c2bffa6bdce56 /net
parente15e6119062d20cc96f95c8b345e361589a90244 (diff)
parent4f924b2aa4d3cb30f07e57d6b608838edcbc0d88 (diff)
downloadlinux-ea44083a7081ac8d9cc84d49525e6041025a7a17.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking update from David Miller: 1) Propagate return error values properly in irda, spider_net, sfc, and bfin_mac. From Wei Yongjun. 2) Fix fec driver OOPS on rapid link up/down, from Frank Li. 3) FIX VF resource allocation and chip message payload length errors in be2net driver, from Sathya Perla. 4) Fix inner protocol inspection during GSO from Pravin B Shelar. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: if_cablemodem.h: Add parenthesis around ioctl macros gso: Handle Trans-Ether-Bridging protocol in skb_network_protocol() net: fec: fix kernel oops when plug/unplug cable many times bfin_mac: fix error return code in bfin_mac_probe() sfc: fix return value check in efx_ptp_probe_channel() net/spider_net: fix error return code in spider_net_open() net/irda: fix error return code in bfin_sir_open() net: of_mdio: fix behavior on missing phy device sierra_net: keep status interrupt URB active usbnet: allow status interrupt URB to always be active qmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN card be2net: disable TX in be_close() be2net: fix EQ from getting full while cleaning RX CQ be2net: fix payload_len value for GET_MAC_LIST cmd req be2net: provision VF resources before enabling SR-IOV
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c11
-rw-r--r--net/ipv4/gre.c8
-rw-r--r--net/ipv4/udp.c4
3 files changed, 13 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 40b1fadaf637..fc1e289397f5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2213,6 +2213,17 @@ __be16 skb_network_protocol(struct sk_buff *skb)
__be16 type = skb->protocol;
int vlan_depth = ETH_HLEN;
+ /* Tunnel gso handlers can set protocol to ethernet. */
+ if (type == htons(ETH_P_TEB)) {
+ struct ethhdr *eth;
+
+ if (unlikely(!pskb_may_pull(skb, sizeof(struct ethhdr))))
+ return 0;
+
+ eth = (struct ethhdr *)skb_mac_header(skb);
+ type = eth->h_proto;
+ }
+
while (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) {
struct vlan_hdr *vh;
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index cc22363965d2..b2e805af9b87 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -150,13 +150,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
csum = false;
/* setup inner skb. */
- if (greh->protocol == htons(ETH_P_TEB)) {
- struct ethhdr *eth = (struct ethhdr *)skb_inner_mac_header(skb);
- skb->protocol = eth->h_proto;
- } else {
- skb->protocol = greh->protocol;
- }
-
+ skb->protocol = greh->protocol;
skb->encapsulation = 0;
if (unlikely(!pskb_may_pull(skb, ghl)))
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 0ae038a4c7a8..0bf5d399a03c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2311,7 +2311,6 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
struct sk_buff *segs = ERR_PTR(-EINVAL);
int mac_len = skb->mac_len;
int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
- struct ethhdr *inner_eth = (struct ethhdr *)skb_inner_mac_header(skb);
__be16 protocol = skb->protocol;
netdev_features_t enc_features;
int outer_hlen;
@@ -2324,8 +2323,7 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
skb_reset_mac_header(skb);
skb_set_network_header(skb, skb_inner_network_offset(skb));
skb->mac_len = skb_inner_network_offset(skb);
- inner_eth = (struct ethhdr *)skb_mac_header(skb);
- skb->protocol = inner_eth->h_proto;
+ skb->protocol = htons(ETH_P_TEB);
/* segment inner packet. */
enc_features = skb->dev->hw_enc_features & netif_skb_features(skb);