diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 35 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_input.c | 3 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 1 | ||||
-rw-r--r-- | net/ipv6/sit.c | 1 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 3 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 6 |
7 files changed, 43 insertions, 8 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8c1e86afbbf5..43b3c9f89c12 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1916,8 +1916,32 @@ ok: | |||
1916 | update_lft = 1; | 1916 | update_lft = 1; |
1917 | else if (stored_lft <= MIN_VALID_LIFETIME) { | 1917 | else if (stored_lft <= MIN_VALID_LIFETIME) { |
1918 | /* valid_lft <= stored_lft is always true */ | 1918 | /* valid_lft <= stored_lft is always true */ |
1919 | /* XXX: IPsec */ | 1919 | /* |
1920 | update_lft = 0; | 1920 | * RFC 4862 Section 5.5.3e: |
1921 | * "Note that the preferred lifetime of | ||
1922 | * the corresponding address is always | ||
1923 | * reset to the Preferred Lifetime in | ||
1924 | * the received Prefix Information | ||
1925 | * option, regardless of whether the | ||
1926 | * valid lifetime is also reset or | ||
1927 | * ignored." | ||
1928 | * | ||
1929 | * So if the preferred lifetime in | ||
1930 | * this advertisement is different | ||
1931 | * than what we have stored, but the | ||
1932 | * valid lifetime is invalid, just | ||
1933 | * reset prefered_lft. | ||
1934 | * | ||
1935 | * We must set the valid lifetime | ||
1936 | * to the stored lifetime since we'll | ||
1937 | * be updating the timestamp below, | ||
1938 | * else we'll set it back to the | ||
1939 | * minumum. | ||
1940 | */ | ||
1941 | if (prefered_lft != ifp->prefered_lft) { | ||
1942 | valid_lft = stored_lft; | ||
1943 | update_lft = 1; | ||
1944 | } | ||
1921 | } else { | 1945 | } else { |
1922 | valid_lft = MIN_VALID_LIFETIME; | 1946 | valid_lft = MIN_VALID_LIFETIME; |
1923 | if (valid_lft < prefered_lft) | 1947 | if (valid_lft < prefered_lft) |
@@ -3085,7 +3109,7 @@ restart: | |||
3085 | spin_unlock(&ifp->lock); | 3109 | spin_unlock(&ifp->lock); |
3086 | continue; | 3110 | continue; |
3087 | } else if (age >= ifp->prefered_lft) { | 3111 | } else if (age >= ifp->prefered_lft) { |
3088 | /* jiffies - ifp->tsamp > age >= ifp->prefered_lft */ | 3112 | /* jiffies - ifp->tstamp > age >= ifp->prefered_lft */ |
3089 | int deprecate = 0; | 3113 | int deprecate = 0; |
3090 | 3114 | ||
3091 | if (!(ifp->flags&IFA_F_DEPRECATED)) { | 3115 | if (!(ifp->flags&IFA_F_DEPRECATED)) { |
@@ -3362,7 +3386,10 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa, | |||
3362 | valid = ifa->valid_lft; | 3386 | valid = ifa->valid_lft; |
3363 | if (preferred != INFINITY_LIFE_TIME) { | 3387 | if (preferred != INFINITY_LIFE_TIME) { |
3364 | long tval = (jiffies - ifa->tstamp)/HZ; | 3388 | long tval = (jiffies - ifa->tstamp)/HZ; |
3365 | preferred -= tval; | 3389 | if (preferred > tval) |
3390 | preferred -= tval; | ||
3391 | else | ||
3392 | preferred = 0; | ||
3366 | if (valid != INFINITY_LIFE_TIME) | 3393 | if (valid != INFINITY_LIFE_TIME) |
3367 | valid -= tval; | 3394 | valid -= tval; |
3368 | } | 3395 | } |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 85b3d0036afd..caa0278d30a9 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -1284,6 +1284,8 @@ static void __exit inet6_exit(void) | |||
1284 | proto_unregister(&udplitev6_prot); | 1284 | proto_unregister(&udplitev6_prot); |
1285 | proto_unregister(&udpv6_prot); | 1285 | proto_unregister(&udpv6_prot); |
1286 | proto_unregister(&tcpv6_prot); | 1286 | proto_unregister(&tcpv6_prot); |
1287 | |||
1288 | rcu_barrier(); /* Wait for completion of call_rcu()'s */ | ||
1287 | } | 1289 | } |
1288 | module_exit(inet6_exit); | 1290 | module_exit(inet6_exit); |
1289 | 1291 | ||
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index c3a07d75b5f5..6d6a4277c677 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -139,6 +139,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
139 | 139 | ||
140 | rcu_read_unlock(); | 140 | rcu_read_unlock(); |
141 | 141 | ||
142 | /* Must drop socket now because of tproxy. */ | ||
143 | skb_orphan(skb); | ||
144 | |||
142 | return NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, dev, NULL, | 145 | return NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, dev, NULL, |
143 | ip6_rcv_finish); | 146 | ip6_rcv_finish); |
144 | err: | 147 | err: |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 7c76e3d18215..87f8419a68fd 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -1484,7 +1484,6 @@ int ip6_push_pending_frames(struct sock *sk) | |||
1484 | skb->len += tmp_skb->len; | 1484 | skb->len += tmp_skb->len; |
1485 | skb->data_len += tmp_skb->len; | 1485 | skb->data_len += tmp_skb->len; |
1486 | skb->truesize += tmp_skb->truesize; | 1486 | skb->truesize += tmp_skb->truesize; |
1487 | __sock_put(tmp_skb->sk); | ||
1488 | tmp_skb->destructor = NULL; | 1487 | tmp_skb->destructor = NULL; |
1489 | tmp_skb->sk = NULL; | 1488 | tmp_skb->sk = NULL; |
1490 | } | 1489 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 68e52308e552..98b7327d0949 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -1018,6 +1018,7 @@ static void ipip6_tunnel_setup(struct net_device *dev) | |||
1018 | dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); | 1018 | dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); |
1019 | dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); | 1019 | dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); |
1020 | dev->flags = IFF_NOARP; | 1020 | dev->flags = IFF_NOARP; |
1021 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | ||
1021 | dev->iflink = 0; | 1022 | dev->iflink = 0; |
1022 | dev->addr_len = 4; | 1023 | dev->addr_len = 4; |
1023 | dev->features |= NETIF_F_NETNS_LOCAL; | 1024 | dev->features |= NETIF_F_NETNS_LOCAL; |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 58810c65b635..d849dd53b788 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -896,6 +896,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = { | |||
896 | #ifdef CONFIG_TCP_MD5SIG | 896 | #ifdef CONFIG_TCP_MD5SIG |
897 | static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { | 897 | static struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { |
898 | .md5_lookup = tcp_v6_reqsk_md5_lookup, | 898 | .md5_lookup = tcp_v6_reqsk_md5_lookup, |
899 | .calc_md5_hash = tcp_v6_md5_hash_skb, | ||
899 | }; | 900 | }; |
900 | #endif | 901 | #endif |
901 | 902 | ||
@@ -1441,7 +1442,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1441 | */ | 1442 | */ |
1442 | char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC); | 1443 | char *newkey = kmemdup(key->key, key->keylen, GFP_ATOMIC); |
1443 | if (newkey != NULL) | 1444 | if (newkey != NULL) |
1444 | tcp_v6_md5_do_add(newsk, &inet6_sk(sk)->daddr, | 1445 | tcp_v6_md5_do_add(newsk, &newnp->daddr, |
1445 | newkey, key->keylen); | 1446 | newkey, key->keylen); |
1446 | } | 1447 | } |
1447 | #endif | 1448 | #endif |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index b4b16a43f277..3a3c677bc0f2 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -157,7 +157,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
157 | ipv6_addr_copy(&fl->fl6_dst, reverse ? &hdr->saddr : &hdr->daddr); | 157 | ipv6_addr_copy(&fl->fl6_dst, reverse ? &hdr->saddr : &hdr->daddr); |
158 | ipv6_addr_copy(&fl->fl6_src, reverse ? &hdr->daddr : &hdr->saddr); | 158 | ipv6_addr_copy(&fl->fl6_src, reverse ? &hdr->daddr : &hdr->saddr); |
159 | 159 | ||
160 | while (pskb_may_pull(skb, nh + offset + 1 - skb->data)) { | 160 | while (nh + offset + 1 < skb->data || |
161 | pskb_may_pull(skb, nh + offset + 1 - skb->data)) { | ||
161 | nh = skb_network_header(skb); | 162 | nh = skb_network_header(skb); |
162 | exthdr = (struct ipv6_opt_hdr *)(nh + offset); | 163 | exthdr = (struct ipv6_opt_hdr *)(nh + offset); |
163 | 164 | ||
@@ -177,7 +178,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
177 | case IPPROTO_TCP: | 178 | case IPPROTO_TCP: |
178 | case IPPROTO_SCTP: | 179 | case IPPROTO_SCTP: |
179 | case IPPROTO_DCCP: | 180 | case IPPROTO_DCCP: |
180 | if (!onlyproto && pskb_may_pull(skb, nh + offset + 4 - skb->data)) { | 181 | if (!onlyproto && (nh + offset + 4 < skb->data || |
182 | pskb_may_pull(skb, nh + offset + 4 - skb->data))) { | ||
181 | __be16 *ports = (__be16 *)exthdr; | 183 | __be16 *ports = (__be16 *)exthdr; |
182 | 184 | ||
183 | fl->fl_ip_sport = ports[!!reverse]; | 185 | fl->fl_ip_sport = ports[!!reverse]; |