aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6_gre.c')
-rw-r--r--net/ipv6/ip6_gre.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index ab0efaca4a78..9d1a54de33f2 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -409,13 +409,16 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
409 case ICMPV6_DEST_UNREACH: 409 case ICMPV6_DEST_UNREACH:
410 net_dbg_ratelimited("%s: Path to destination invalid or inactive!\n", 410 net_dbg_ratelimited("%s: Path to destination invalid or inactive!\n",
411 t->parms.name); 411 t->parms.name);
412 break; 412 if (code != ICMPV6_PORT_UNREACH)
413 break;
414 return;
413 case ICMPV6_TIME_EXCEED: 415 case ICMPV6_TIME_EXCEED:
414 if (code == ICMPV6_EXC_HOPLIMIT) { 416 if (code == ICMPV6_EXC_HOPLIMIT) {
415 net_dbg_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n", 417 net_dbg_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n",
416 t->parms.name); 418 t->parms.name);
419 break;
417 } 420 }
418 break; 421 return;
419 case ICMPV6_PARAMPROB: 422 case ICMPV6_PARAMPROB:
420 teli = 0; 423 teli = 0;
421 if (code == ICMPV6_HDR_FIELD) 424 if (code == ICMPV6_HDR_FIELD)
@@ -431,13 +434,13 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
431 net_dbg_ratelimited("%s: Recipient unable to parse tunneled packet!\n", 434 net_dbg_ratelimited("%s: Recipient unable to parse tunneled packet!\n",
432 t->parms.name); 435 t->parms.name);
433 } 436 }
434 break; 437 return;
435 case ICMPV6_PKT_TOOBIG: 438 case ICMPV6_PKT_TOOBIG:
436 mtu = be32_to_cpu(info) - offset; 439 mtu = be32_to_cpu(info) - offset;
437 if (mtu < IPV6_MIN_MTU) 440 if (mtu < IPV6_MIN_MTU)
438 mtu = IPV6_MIN_MTU; 441 mtu = IPV6_MIN_MTU;
439 t->dev->mtu = mtu; 442 t->dev->mtu = mtu;
440 break; 443 return;
441 } 444 }
442 445
443 if (time_before(jiffies, t->err_time + IP6TUNNEL_ERR_TIMEO)) 446 if (time_before(jiffies, t->err_time + IP6TUNNEL_ERR_TIMEO))
@@ -1177,24 +1180,25 @@ static int ip6gre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
1177} 1180}
1178 1181
1179static int ip6gre_header(struct sk_buff *skb, struct net_device *dev, 1182static int ip6gre_header(struct sk_buff *skb, struct net_device *dev,
1180 unsigned short type, 1183 unsigned short type, const void *daddr,
1181 const void *daddr, const void *saddr, unsigned int len) 1184 const void *saddr, unsigned int len)
1182{ 1185{
1183 struct ip6_tnl *t = netdev_priv(dev); 1186 struct ip6_tnl *t = netdev_priv(dev);
1184 struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb_push(skb, t->hlen); 1187 struct ipv6hdr *ipv6h;
1185 __be16 *p = (__be16 *)(ipv6h+1); 1188 __be16 *p;
1186 1189
1187 ip6_flow_hdr(ipv6h, 0, 1190 ipv6h = (struct ipv6hdr *)skb_push(skb, t->hlen + sizeof(*ipv6h));
1188 ip6_make_flowlabel(dev_net(dev), skb, 1191 ip6_flow_hdr(ipv6h, 0, ip6_make_flowlabel(dev_net(dev), skb,
1189 t->fl.u.ip6.flowlabel, true, 1192 t->fl.u.ip6.flowlabel,
1190 &t->fl.u.ip6)); 1193 true, &t->fl.u.ip6));
1191 ipv6h->hop_limit = t->parms.hop_limit; 1194 ipv6h->hop_limit = t->parms.hop_limit;
1192 ipv6h->nexthdr = NEXTHDR_GRE; 1195 ipv6h->nexthdr = NEXTHDR_GRE;
1193 ipv6h->saddr = t->parms.laddr; 1196 ipv6h->saddr = t->parms.laddr;
1194 ipv6h->daddr = t->parms.raddr; 1197 ipv6h->daddr = t->parms.raddr;
1195 1198
1196 p[0] = t->parms.o_flags; 1199 p = (__be16 *)(ipv6h + 1);
1197 p[1] = htons(type); 1200 p[0] = t->parms.o_flags;
1201 p[1] = htons(type);
1198 1202
1199 /* 1203 /*
1200 * Set the source hardware address. 1204 * Set the source hardware address.