diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/esp6.c | 2 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 22 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_queue.c | 8 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_beet.c | 1 | ||||
-rw-r--r-- | net/ipv6/xfrm6_mode_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv6/xfrm6_output.c | 2 | ||||
-rw-r--r-- | net/ipv6/xfrm6_state.c | 2 |
7 files changed, 27 insertions, 12 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 0ec1402320ea..c6bb4c6d24b3 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -282,7 +282,7 @@ static int esp6_input(struct xfrm_state *x, struct sk_buff *skb) | |||
282 | struct scatterlist *sg; | 282 | struct scatterlist *sg; |
283 | struct scatterlist *asg; | 283 | struct scatterlist *asg; |
284 | 284 | ||
285 | if (!pskb_may_pull(skb, sizeof(*esph))) { | 285 | if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) { |
286 | ret = -EINVAL; | 286 | ret = -EINVAL; |
287 | goto out; | 287 | goto out; |
288 | } | 288 | } |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index b4d8e331432e..e77b74edfd63 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -661,6 +661,20 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb) | |||
661 | } | 661 | } |
662 | } | 662 | } |
663 | 663 | ||
664 | static struct pneigh_entry *pndisc_check_router(struct net_device *dev, | ||
665 | struct in6_addr *addr, int *is_router) | ||
666 | { | ||
667 | struct pneigh_entry *n; | ||
668 | |||
669 | read_lock_bh(&nd_tbl.lock); | ||
670 | n = __pneigh_lookup(&nd_tbl, dev_net(dev), addr, dev); | ||
671 | if (n != NULL) | ||
672 | *is_router = (n->flags & NTF_ROUTER); | ||
673 | read_unlock_bh(&nd_tbl.lock); | ||
674 | |||
675 | return n; | ||
676 | } | ||
677 | |||
664 | static void ndisc_recv_ns(struct sk_buff *skb) | 678 | static void ndisc_recv_ns(struct sk_buff *skb) |
665 | { | 679 | { |
666 | struct nd_msg *msg = (struct nd_msg *)skb_transport_header(skb); | 680 | struct nd_msg *msg = (struct nd_msg *)skb_transport_header(skb); |
@@ -677,7 +691,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
677 | struct pneigh_entry *pneigh = NULL; | 691 | struct pneigh_entry *pneigh = NULL; |
678 | int dad = ipv6_addr_any(saddr); | 692 | int dad = ipv6_addr_any(saddr); |
679 | int inc; | 693 | int inc; |
680 | int is_router; | 694 | int is_router = 0; |
681 | 695 | ||
682 | if (ipv6_addr_is_multicast(&msg->target)) { | 696 | if (ipv6_addr_is_multicast(&msg->target)) { |
683 | ND_PRINTK2(KERN_WARNING | 697 | ND_PRINTK2(KERN_WARNING |
@@ -776,8 +790,8 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
776 | if (ipv6_chk_acast_addr(dev_net(dev), dev, &msg->target) || | 790 | if (ipv6_chk_acast_addr(dev_net(dev), dev, &msg->target) || |
777 | (idev->cnf.forwarding && | 791 | (idev->cnf.forwarding && |
778 | (ipv6_devconf.proxy_ndp || idev->cnf.proxy_ndp) && | 792 | (ipv6_devconf.proxy_ndp || idev->cnf.proxy_ndp) && |
779 | (pneigh = pneigh_lookup(&nd_tbl, dev_net(dev), | 793 | (pneigh = pndisc_check_router(dev, &msg->target, |
780 | &msg->target, dev, 0)) != NULL)) { | 794 | &is_router)) != NULL)) { |
781 | if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && | 795 | if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && |
782 | skb->pkt_type != PACKET_HOST && | 796 | skb->pkt_type != PACKET_HOST && |
783 | inc != 0 && | 797 | inc != 0 && |
@@ -798,7 +812,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
798 | goto out; | 812 | goto out; |
799 | } | 813 | } |
800 | 814 | ||
801 | is_router = !!(pneigh ? pneigh->flags & NTF_ROUTER : idev->cnf.forwarding); | 815 | is_router = !!(pneigh ? is_router : idev->cnf.forwarding); |
802 | 816 | ||
803 | if (dad) { | 817 | if (dad) { |
804 | struct in6_addr maddr; | 818 | struct in6_addr maddr; |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index a6d30626b47c..92a36c9e5402 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -591,11 +591,9 @@ static int __init ip6_queue_init(void) | |||
591 | } | 591 | } |
592 | 592 | ||
593 | #ifdef CONFIG_PROC_FS | 593 | #ifdef CONFIG_PROC_FS |
594 | proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net); | 594 | proc = proc_create(IPQ_PROC_FS_NAME, 0, init_net.proc_net, |
595 | if (proc) { | 595 | &ip6_queue_proc_fops); |
596 | proc->owner = THIS_MODULE; | 596 | if (!proc) { |
597 | proc->proc_fops = &ip6_queue_proc_fops; | ||
598 | } else { | ||
599 | printk(KERN_ERR "ip6_queue: failed to create proc entry\n"); | 597 | printk(KERN_ERR "ip6_queue: failed to create proc entry\n"); |
600 | goto cleanup_ipqnl; | 598 | goto cleanup_ipqnl; |
601 | } | 599 | } |
diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c index 0527d11c1ae3..d6ce400f585f 100644 --- a/net/ipv6/xfrm6_mode_beet.c +++ b/net/ipv6/xfrm6_mode_beet.c | |||
@@ -45,6 +45,7 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct sk_buff *skb) | |||
45 | skb->mac_header = skb->network_header + | 45 | skb->mac_header = skb->network_header + |
46 | offsetof(struct ipv6hdr, nexthdr); | 46 | offsetof(struct ipv6hdr, nexthdr); |
47 | skb->transport_header = skb->network_header + sizeof(*top_iph); | 47 | skb->transport_header = skb->network_header + sizeof(*top_iph); |
48 | __skb_pull(skb, XFRM_MODE_SKB_CB(skb)->ihl); | ||
48 | 49 | ||
49 | xfrm6_beet_make_header(skb); | 50 | xfrm6_beet_make_header(skb); |
50 | 51 | ||
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c index 0c742faaa30b..e20529b4c825 100644 --- a/net/ipv6/xfrm6_mode_tunnel.c +++ b/net/ipv6/xfrm6_mode_tunnel.c | |||
@@ -45,7 +45,7 @@ static int xfrm6_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) | |||
45 | 45 | ||
46 | memcpy(top_iph->flow_lbl, XFRM_MODE_SKB_CB(skb)->flow_lbl, | 46 | memcpy(top_iph->flow_lbl, XFRM_MODE_SKB_CB(skb)->flow_lbl, |
47 | sizeof(top_iph->flow_lbl)); | 47 | sizeof(top_iph->flow_lbl)); |
48 | top_iph->nexthdr = x->inner_mode->afinfo->proto; | 48 | top_iph->nexthdr = xfrm_af2proto(skb->dst->ops->family); |
49 | 49 | ||
50 | dsfield = XFRM_MODE_SKB_CB(skb)->tos; | 50 | dsfield = XFRM_MODE_SKB_CB(skb)->tos; |
51 | dsfield = INET_ECN_encapsulate(dsfield, dsfield); | 51 | dsfield = INET_ECN_encapsulate(dsfield, dsfield); |
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 79ccfb080733..0af823cf7f1f 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c | |||
@@ -62,7 +62,7 @@ int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb) | |||
62 | { | 62 | { |
63 | int err; | 63 | int err; |
64 | 64 | ||
65 | err = x->inner_mode->afinfo->extract_output(x, skb); | 65 | err = xfrm_inner_extract_output(x, skb); |
66 | if (err) | 66 | if (err) |
67 | return err; | 67 | return err; |
68 | 68 | ||
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c index 5a46bb99c3af..89884a4f23aa 100644 --- a/net/ipv6/xfrm6_state.c +++ b/net/ipv6/xfrm6_state.c | |||
@@ -151,10 +151,12 @@ int xfrm6_extract_header(struct sk_buff *skb) | |||
151 | { | 151 | { |
152 | struct ipv6hdr *iph = ipv6_hdr(skb); | 152 | struct ipv6hdr *iph = ipv6_hdr(skb); |
153 | 153 | ||
154 | XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); | ||
154 | XFRM_MODE_SKB_CB(skb)->id = 0; | 155 | XFRM_MODE_SKB_CB(skb)->id = 0; |
155 | XFRM_MODE_SKB_CB(skb)->frag_off = htons(IP_DF); | 156 | XFRM_MODE_SKB_CB(skb)->frag_off = htons(IP_DF); |
156 | XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); | 157 | XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); |
157 | XFRM_MODE_SKB_CB(skb)->ttl = iph->hop_limit; | 158 | XFRM_MODE_SKB_CB(skb)->ttl = iph->hop_limit; |
159 | XFRM_MODE_SKB_CB(skb)->optlen = 0; | ||
158 | memcpy(XFRM_MODE_SKB_CB(skb)->flow_lbl, iph->flow_lbl, | 160 | memcpy(XFRM_MODE_SKB_CB(skb)->flow_lbl, iph->flow_lbl, |
159 | sizeof(XFRM_MODE_SKB_CB(skb)->flow_lbl)); | 161 | sizeof(XFRM_MODE_SKB_CB(skb)->flow_lbl)); |
160 | 162 | ||