summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-03-13 02:37:49 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-28 12:17:09 -0700
commitdeaf53680597dff17be94d6a075fc5ec3a29fe98 (patch)
tree1619b8e10fc65af35ca4ccfe8d223ea786867b84 /net
parentb7cfed260b97e046165bde45c63f7f718aaf6871 (diff)
Revert "ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally"
[ Upstream commit 8c6216d7f118a128678270824b6a1286a63863ca ] This reverts commit 412ed94744d16806fbec3bd250fd94e71cde5a1f. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_gre.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index e81b1caf2ea2..a85062b72116 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -761,10 +761,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;