aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/dsa/slave.c2
-rw-r--r--net/ipv4/gre_offload.c6
-rw-r--r--net/ipv6/ip6_offload.c1
-rw-r--r--net/ipv6/sit.c6
4 files changed, 8 insertions, 7 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index a851e9f14118..6d1817449c36 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -599,7 +599,7 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
599 netif_carrier_off(slave_dev); 599 netif_carrier_off(slave_dev);
600 600
601 if (p->phy != NULL) { 601 if (p->phy != NULL) {
602 if (ds->drv->get_phy_flags(ds, port)) 602 if (ds->drv->get_phy_flags)
603 p->phy->dev_flags |= ds->drv->get_phy_flags(ds, port); 603 p->phy->dev_flags |= ds->drv->get_phy_flags(ds, port);
604 604
605 phy_attach(slave_dev, dev_name(&p->phy->dev), 605 phy_attach(slave_dev, dev_name(&p->phy->dev),
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index a77729503071..ccda09628de7 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -55,13 +55,13 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
55 if (csum) 55 if (csum)
56 skb->encap_hdr_csum = 1; 56 skb->encap_hdr_csum = 1;
57 57
58 if (unlikely(!pskb_may_pull(skb, ghl)))
59 goto out;
60
61 /* setup inner skb. */ 58 /* setup inner skb. */
62 skb->protocol = greh->protocol; 59 skb->protocol = greh->protocol;
63 skb->encapsulation = 0; 60 skb->encapsulation = 0;
64 61
62 if (unlikely(!pskb_may_pull(skb, ghl)))
63 goto out;
64
65 __skb_pull(skb, ghl); 65 __skb_pull(skb, ghl);
66 skb_reset_mac_header(skb); 66 skb_reset_mac_header(skb);
67 skb_set_network_header(skb, skb_inner_network_offset(skb)); 67 skb_set_network_header(skb, skb_inner_network_offset(skb));
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index 9034f76ae013..91014d32488d 100644
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -46,6 +46,7 @@ static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
46 if (unlikely(!pskb_may_pull(skb, len))) 46 if (unlikely(!pskb_may_pull(skb, len)))
47 break; 47 break;
48 48
49 opth = (void *)skb->data;
49 proto = opth->nexthdr; 50 proto = opth->nexthdr;
50 __skb_pull(skb, len); 51 __skb_pull(skb, len);
51 } 52 }
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 6eab37cf5345..58e5b4710127 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -485,11 +485,11 @@ static void ipip6_tunnel_uninit(struct net_device *dev)
485 */ 485 */
486static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb) 486static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb)
487{ 487{
488 const struct iphdr *iph = (const struct iphdr *) skb->data; 488 int ihl = ((const struct iphdr *)skb->data)->ihl*4;
489 struct rt6_info *rt; 489 struct rt6_info *rt;
490 struct sk_buff *skb2; 490 struct sk_buff *skb2;
491 491
492 if (!pskb_may_pull(skb, iph->ihl * 4 + sizeof(struct ipv6hdr) + 8)) 492 if (!pskb_may_pull(skb, ihl + sizeof(struct ipv6hdr) + 8))
493 return 1; 493 return 1;
494 494
495 skb2 = skb_clone(skb, GFP_ATOMIC); 495 skb2 = skb_clone(skb, GFP_ATOMIC);
@@ -498,7 +498,7 @@ static int ipip6_err_gen_icmpv6_unreach(struct sk_buff *skb)
498 return 1; 498 return 1;
499 499
500 skb_dst_drop(skb2); 500 skb_dst_drop(skb2);
501 skb_pull(skb2, iph->ihl * 4); 501 skb_pull(skb2, ihl);
502 skb_reset_network_header(skb2); 502 skb_reset_network_header(skb2);
503 503
504 rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0); 504 rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, NULL, 0, 0);