Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348012
b: refs/heads/master
c: f7e75ba
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 21, 2012
1 parent a6affa5 commit 8f20cf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 412ed94744d16806fbec3bd250fd94e71cde5a1f
refs/heads/master: f7e75ba1772bc712af0070655ffd8b09906993b5
6 changes: 5 additions & 1 deletion trunk/net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
int gre_hlen;
__be32 dst;
int mtu;
u8 ttl;

if (skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
Expand Down Expand Up @@ -815,6 +816,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
goto tx_error;
}

ttl = tiph->ttl;
tos = tiph->tos;
if (tos == 1) {
tos = 0;
Expand Down Expand Up @@ -907,6 +909,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
dev_kfree_skb(skb);
skb = new_skb;
old_iph = ip_hdr(skb);
/* Warning : tiph value might point to freed memory */
}

skb_reset_transport_header(skb);
Expand All @@ -930,8 +933,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
iph->tos = ipgre_ecn_encapsulate(tos, old_iph, skb);
iph->daddr = fl4.daddr;
iph->saddr = fl4.saddr;
iph->ttl = ttl;

if ((iph->ttl = tiph->ttl) == 0) {
if (ttl == 0) {
if (skb->protocol == htons(ETH_P_IP))
iph->ttl = old_iph->ttl;
#if IS_ENABLED(CONFIG_IPV6)
Expand Down

0 comments on commit 8f20cf4

Please sign in to comment.