mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 10:33:27 +00:00
ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally
ipgre_tunnel_xmit() parses network header as IP unconditionally. But transmitting packets are not always IP packet. For example such packet can be sent by packet socket with sockaddr_ll.sll_protocol set. So make the function check if skb->protocol is IP. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
29042073e7
commit
412ed94744
1 changed files with 4 additions and 1 deletions
|
@ -760,7 +760,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
|
|||
|
||||
if (dev->header_ops && dev->type == ARPHRD_IPGRE) {
|
||||
gre_hlen = 0;
|
||||
tiph = (const struct iphdr *)skb->data;
|
||||
if (skb->protocol == htons(ETH_P_IP))
|
||||
tiph = (const struct iphdr *)skb->data;
|
||||
else
|
||||
tiph = &tunnel->parms.iph;
|
||||
} else {
|
||||
gre_hlen = tunnel->hlen;
|
||||
tiph = &tunnel->parms.iph;
|
||||
|
|
Loading…
Reference in a new issue