Skip to content

Commit

Permalink
Revert "ip_gre: make ipgre_tunnel_xmit() not parse network header as …
Browse files Browse the repository at this point in the history
…IP unconditionally"

This reverts commit 412ed94.

The commit is wrong as tiph points to the outer IPv4 header which is
installed at ipgre_header() and not the inner one which is protocol dependant.

This commit broke succesfully opennhrp which use PF_PACKET socket with
ETH_P_NHRP protocol. Additionally ssl_addr is set to the link-layer
IPv4 address. This address is written by ipgre_header() to the skb
earlier, and this is the IPv4 header tiph should point to - regardless
of the inner protocol payload.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Timo Teräs authored and David S. Miller committed Mar 17, 2013
1 parent aaa0c23 commit 8c6216d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,7 @@ 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;
if (skb->protocol == htons(ETH_P_IP))
tiph = (const struct iphdr *)skb->data;
else
tiph = &tunnel->parms.iph;
tiph = (const struct iphdr *)skb->data;
} else {
gre_hlen = tunnel->hlen;
tiph = &tunnel->parms.iph;
Expand Down

0 comments on commit 8c6216d

Please sign in to comment.