diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-05-07 16:41:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-08 16:13:30 -0400 |
commit | 19acc327258ac5bcd0f31c07853e6d9784010fb4 (patch) | |
tree | 4079bd2f20e09ebc1f9b23b2eef4ec6976801c74 /net/ipv4/udp.c | |
parent | 54309fa60b5f57b90c1842176f6045e665d21142 (diff) |
gso: Handle Trans-Ether-Bridging protocol in skb_network_protocol()
Rather than having logic to calculate inner protocol in every
tunnel gso handler move it to gso code. This simplifies code.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Cong Wang <amwang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 4 |
1 files changed, 1 insertions, 3 deletions
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, | |||
2311 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 2311 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
2312 | int mac_len = skb->mac_len; | 2312 | int mac_len = skb->mac_len; |
2313 | int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb); | 2313 | int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb); |
2314 | struct ethhdr *inner_eth = (struct ethhdr *)skb_inner_mac_header(skb); | ||
2315 | __be16 protocol = skb->protocol; | 2314 | __be16 protocol = skb->protocol; |
2316 | netdev_features_t enc_features; | 2315 | netdev_features_t enc_features; |
2317 | int outer_hlen; | 2316 | int outer_hlen; |
@@ -2324,8 +2323,7 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | |||
2324 | skb_reset_mac_header(skb); | 2323 | skb_reset_mac_header(skb); |
2325 | skb_set_network_header(skb, skb_inner_network_offset(skb)); | 2324 | skb_set_network_header(skb, skb_inner_network_offset(skb)); |
2326 | skb->mac_len = skb_inner_network_offset(skb); | 2325 | skb->mac_len = skb_inner_network_offset(skb); |
2327 | inner_eth = (struct ethhdr *)skb_mac_header(skb); | 2326 | skb->protocol = htons(ETH_P_TEB); |
2328 | skb->protocol = inner_eth->h_proto; | ||
2329 | 2327 | ||
2330 | /* segment inner packet. */ | 2328 | /* segment inner packet. */ |
2331 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); | 2329 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); |