diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/icmp.c | 6 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_REJECT.c | 2 | ||||
-rw-r--r-- | net/ipv6/raw.c | 5 |
4 files changed, 10 insertions, 5 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index fcf883183cef..21eb725e885f 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/net.h> | 42 | #include <linux/net.h> |
43 | #include <linux/skbuff.h> | 43 | #include <linux/skbuff.h> |
44 | #include <linux/init.h> | 44 | #include <linux/init.h> |
45 | #include <linux/netfilter.h> | ||
45 | 46 | ||
46 | #ifdef CONFIG_SYSCTL | 47 | #ifdef CONFIG_SYSCTL |
47 | #include <linux/sysctl.h> | 48 | #include <linux/sysctl.h> |
@@ -255,6 +256,7 @@ out: | |||
255 | struct icmpv6_msg { | 256 | struct icmpv6_msg { |
256 | struct sk_buff *skb; | 257 | struct sk_buff *skb; |
257 | int offset; | 258 | int offset; |
259 | uint8_t type; | ||
258 | }; | 260 | }; |
259 | 261 | ||
260 | static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) | 262 | static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) |
@@ -266,6 +268,8 @@ static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, st | |||
266 | csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset, | 268 | csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset, |
267 | to, len, csum); | 269 | to, len, csum); |
268 | skb->csum = csum_block_add(skb->csum, csum, odd); | 270 | skb->csum = csum_block_add(skb->csum, csum, odd); |
271 | if (!(msg->type & ICMPV6_INFOMSG_MASK)) | ||
272 | nf_ct_attach(skb, org_skb); | ||
269 | return 0; | 273 | return 0; |
270 | } | 274 | } |
271 | 275 | ||
@@ -403,6 +407,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
403 | 407 | ||
404 | msg.skb = skb; | 408 | msg.skb = skb; |
405 | msg.offset = skb->nh.raw - skb->data; | 409 | msg.offset = skb->nh.raw - skb->data; |
410 | msg.type = type; | ||
406 | 411 | ||
407 | len = skb->len - msg.offset; | 412 | len = skb->len - msg.offset; |
408 | len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr)); | 413 | len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr)); |
@@ -500,6 +505,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | |||
500 | 505 | ||
501 | msg.skb = skb; | 506 | msg.skb = skb; |
502 | msg.offset = 0; | 507 | msg.offset = 0; |
508 | msg.type = ICMPV6_ECHO_REPLY; | ||
503 | 509 | ||
504 | err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr), | 510 | err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr), |
505 | sizeof(struct icmp6hdr), hlimit, tclass, NULL, &fl, | 511 | sizeof(struct icmp6hdr), hlimit, tclass, NULL, &fl, |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 92ead3cf956b..faea8a120ee2 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -458,7 +458,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
458 | mtu = IPV6_MIN_MTU; | 458 | mtu = IPV6_MIN_MTU; |
459 | t->dev->mtu = mtu; | 459 | t->dev->mtu = mtu; |
460 | 460 | ||
461 | if ((len = sizeof (*ipv6h) + ipv6h->payload_len) > mtu) { | 461 | if ((len = sizeof (*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { |
462 | rel_type = ICMPV6_PKT_TOOBIG; | 462 | rel_type = ICMPV6_PKT_TOOBIG; |
463 | rel_code = 0; | 463 | rel_code = 0; |
464 | rel_info = mtu; | 464 | rel_info = mtu; |
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c index c745717b4ce2..0e6d1d4bbd5c 100644 --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c | |||
@@ -160,6 +160,8 @@ static void send_reset(struct sk_buff *oldskb) | |||
160 | csum_partial((char *)tcph, | 160 | csum_partial((char *)tcph, |
161 | sizeof(struct tcphdr), 0)); | 161 | sizeof(struct tcphdr), 0)); |
162 | 162 | ||
163 | nf_ct_attach(nskb, oldskb); | ||
164 | |||
163 | NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, nskb, NULL, nskb->dst->dev, | 165 | NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, nskb, NULL, nskb->dst->dev, |
164 | dst_output); | 166 | dst_output); |
165 | } | 167 | } |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 738376cf0c51..ae20a0ec9bd8 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -803,10 +803,7 @@ back_from_confirm: | |||
803 | err = rawv6_push_pending_frames(sk, &fl, rp); | 803 | err = rawv6_push_pending_frames(sk, &fl, rp); |
804 | } | 804 | } |
805 | done: | 805 | done: |
806 | ip6_dst_store(sk, dst, | 806 | dst_release(dst); |
807 | ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ? | ||
808 | &np->daddr : NULL); | ||
809 | |||
810 | release_sock(sk); | 807 | release_sock(sk); |
811 | out: | 808 | out: |
812 | fl6_sock_release(flowlabel); | 809 | fl6_sock_release(flowlabel); |