diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 5 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 4 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 11 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 1 | ||||
-rw-r--r-- | net/ipv6/raw.c | 3 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 18 | ||||
-rw-r--r-- | net/ipv6/udp.c | 6 |
8 files changed, 28 insertions, 22 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 91ef3be5abad..45b4c82148a0 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1021,7 +1021,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, | |||
1021 | hiscore.rule++; | 1021 | hiscore.rule++; |
1022 | } | 1022 | } |
1023 | if (ipv6_saddr_preferred(score.addr_type) || | 1023 | if (ipv6_saddr_preferred(score.addr_type) || |
1024 | (((ifa_result->flags & | 1024 | (((ifa->flags & |
1025 | (IFA_F_DEPRECATED|IFA_F_OPTIMISTIC)) == 0))) { | 1025 | (IFA_F_DEPRECATED|IFA_F_OPTIMISTIC)) == 0))) { |
1026 | score.attrs |= IPV6_SADDR_SCORE_PREFERRED; | 1026 | score.attrs |= IPV6_SADDR_SCORE_PREFERRED; |
1027 | if (!(hiscore.attrs & IPV6_SADDR_SCORE_PREFERRED)) { | 1027 | if (!(hiscore.attrs & IPV6_SADDR_SCORE_PREFERRED)) { |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 5dead399fe64..26de3c0ea31e 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -1427,8 +1427,9 @@ void ip6_flush_pending_frames(struct sock *sk) | |||
1427 | struct sk_buff *skb; | 1427 | struct sk_buff *skb; |
1428 | 1428 | ||
1429 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) { | 1429 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) { |
1430 | IP6_INC_STATS(ip6_dst_idev(skb->dst), | 1430 | if (skb->dst) |
1431 | IPSTATS_MIB_OUTDISCARDS); | 1431 | IP6_INC_STATS(ip6_dst_idev(skb->dst), |
1432 | IPSTATS_MIB_OUTDISCARDS); | ||
1432 | kfree_skb(skb); | 1433 | kfree_skb(skb); |
1433 | } | 1434 | } |
1434 | 1435 | ||
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 761a910f4f97..6b038aa72e88 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -554,6 +554,10 @@ done: | |||
554 | { | 554 | { |
555 | struct ipv6_mreq mreq; | 555 | struct ipv6_mreq mreq; |
556 | 556 | ||
557 | retv = -EPROTO; | ||
558 | if (inet_sk(sk)->is_icsk) | ||
559 | break; | ||
560 | |||
557 | retv = -EFAULT; | 561 | retv = -EFAULT; |
558 | if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq))) | 562 | if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq))) |
559 | break; | 563 | break; |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 0358e6066a4e..5b596659177c 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -736,7 +736,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
736 | * so fail our DAD process | 736 | * so fail our DAD process |
737 | */ | 737 | */ |
738 | addrconf_dad_failure(ifp); | 738 | addrconf_dad_failure(ifp); |
739 | goto out; | 739 | return; |
740 | } else { | 740 | } else { |
741 | /* | 741 | /* |
742 | * This is not a dad solicitation. | 742 | * This is not a dad solicitation. |
@@ -1268,9 +1268,10 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) | |||
1268 | 1268 | ||
1269 | if (ipv6_addr_equal(dest, target)) { | 1269 | if (ipv6_addr_equal(dest, target)) { |
1270 | on_link = 1; | 1270 | on_link = 1; |
1271 | } else if (!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { | 1271 | } else if (ipv6_addr_type(target) != |
1272 | (IPV6_ADDR_UNICAST|IPV6_ADDR_LINKLOCAL)) { | ||
1272 | ND_PRINTK2(KERN_WARNING | 1273 | ND_PRINTK2(KERN_WARNING |
1273 | "ICMPv6 Redirect: target address is not link-local.\n"); | 1274 | "ICMPv6 Redirect: target address is not link-local unicast.\n"); |
1274 | return; | 1275 | return; |
1275 | } | 1276 | } |
1276 | 1277 | ||
@@ -1344,9 +1345,9 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | |||
1344 | } | 1345 | } |
1345 | 1346 | ||
1346 | if (!ipv6_addr_equal(&ipv6_hdr(skb)->daddr, target) && | 1347 | if (!ipv6_addr_equal(&ipv6_hdr(skb)->daddr, target) && |
1347 | !(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { | 1348 | ipv6_addr_type(target) != (IPV6_ADDR_UNICAST|IPV6_ADDR_LINKLOCAL)) { |
1348 | ND_PRINTK2(KERN_WARNING | 1349 | ND_PRINTK2(KERN_WARNING |
1349 | "ICMPv6 Redirect: target address is not link-local.\n"); | 1350 | "ICMPv6 Redirect: target address is not link-local unicast.\n"); |
1350 | return; | 1351 | return; |
1351 | } | 1352 | } |
1352 | 1353 | ||
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index aeda617246b7..cd9df02bb85c 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -1462,6 +1462,7 @@ static struct nf_sockopt_ops ip6t_sockopts = { | |||
1462 | .get_optmin = IP6T_BASE_CTL, | 1462 | .get_optmin = IP6T_BASE_CTL, |
1463 | .get_optmax = IP6T_SO_GET_MAX+1, | 1463 | .get_optmax = IP6T_SO_GET_MAX+1, |
1464 | .get = do_ip6t_get_ctl, | 1464 | .get = do_ip6t_get_ctl, |
1465 | .owner = THIS_MODULE, | ||
1465 | }; | 1466 | }; |
1466 | 1467 | ||
1467 | static struct xt_match icmp6_matchstruct __read_mostly = { | 1468 | static struct xt_match icmp6_matchstruct __read_mostly = { |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index e27383d855de..77167afa3455 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -882,11 +882,10 @@ back_from_confirm: | |||
882 | ip6_flush_pending_frames(sk); | 882 | ip6_flush_pending_frames(sk); |
883 | else if (!(msg->msg_flags & MSG_MORE)) | 883 | else if (!(msg->msg_flags & MSG_MORE)) |
884 | err = rawv6_push_pending_frames(sk, &fl, rp); | 884 | err = rawv6_push_pending_frames(sk, &fl, rp); |
885 | release_sock(sk); | ||
885 | } | 886 | } |
886 | done: | 887 | done: |
887 | dst_release(dst); | 888 | dst_release(dst); |
888 | if (!inet->hdrincl) | ||
889 | release_sock(sk); | ||
890 | out: | 889 | out: |
891 | fl6_sock_release(flowlabel); | 890 | fl6_sock_release(flowlabel); |
892 | return err<0?err:len; | 891 | return err<0?err:len; |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0f7defb482e9..3e06799b37a6 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -539,7 +539,7 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk, | |||
539 | 539 | ||
540 | for (i = 0; i < tp->md5sig_info->entries6; i++) { | 540 | for (i = 0; i < tp->md5sig_info->entries6; i++) { |
541 | if (ipv6_addr_cmp(&tp->md5sig_info->keys6[i].addr, addr) == 0) | 541 | if (ipv6_addr_cmp(&tp->md5sig_info->keys6[i].addr, addr) == 0) |
542 | return (struct tcp_md5sig_key *)&tp->md5sig_info->keys6[i]; | 542 | return &tp->md5sig_info->keys6[i].base; |
543 | } | 543 | } |
544 | return NULL; | 544 | return NULL; |
545 | } | 545 | } |
@@ -567,9 +567,9 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, | |||
567 | key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer); | 567 | key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer); |
568 | if (key) { | 568 | if (key) { |
569 | /* modify existing entry - just update that one */ | 569 | /* modify existing entry - just update that one */ |
570 | kfree(key->key); | 570 | kfree(key->base.key); |
571 | key->key = newkey; | 571 | key->base.key = newkey; |
572 | key->keylen = newkeylen; | 572 | key->base.keylen = newkeylen; |
573 | } else { | 573 | } else { |
574 | /* reallocate new list if current one is full. */ | 574 | /* reallocate new list if current one is full. */ |
575 | if (!tp->md5sig_info) { | 575 | if (!tp->md5sig_info) { |
@@ -603,8 +603,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, | |||
603 | 603 | ||
604 | ipv6_addr_copy(&tp->md5sig_info->keys6[tp->md5sig_info->entries6].addr, | 604 | ipv6_addr_copy(&tp->md5sig_info->keys6[tp->md5sig_info->entries6].addr, |
605 | peer); | 605 | peer); |
606 | tp->md5sig_info->keys6[tp->md5sig_info->entries6].key = newkey; | 606 | tp->md5sig_info->keys6[tp->md5sig_info->entries6].base.key = newkey; |
607 | tp->md5sig_info->keys6[tp->md5sig_info->entries6].keylen = newkeylen; | 607 | tp->md5sig_info->keys6[tp->md5sig_info->entries6].base.keylen = newkeylen; |
608 | 608 | ||
609 | tp->md5sig_info->entries6++; | 609 | tp->md5sig_info->entries6++; |
610 | } | 610 | } |
@@ -626,7 +626,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer) | |||
626 | for (i = 0; i < tp->md5sig_info->entries6; i++) { | 626 | for (i = 0; i < tp->md5sig_info->entries6; i++) { |
627 | if (ipv6_addr_cmp(&tp->md5sig_info->keys6[i].addr, peer) == 0) { | 627 | if (ipv6_addr_cmp(&tp->md5sig_info->keys6[i].addr, peer) == 0) { |
628 | /* Free the key */ | 628 | /* Free the key */ |
629 | kfree(tp->md5sig_info->keys6[i].key); | 629 | kfree(tp->md5sig_info->keys6[i].base.key); |
630 | tp->md5sig_info->entries6--; | 630 | tp->md5sig_info->entries6--; |
631 | 631 | ||
632 | if (tp->md5sig_info->entries6 == 0) { | 632 | if (tp->md5sig_info->entries6 == 0) { |
@@ -657,7 +657,7 @@ static void tcp_v6_clear_md5_list (struct sock *sk) | |||
657 | 657 | ||
658 | if (tp->md5sig_info->entries6) { | 658 | if (tp->md5sig_info->entries6) { |
659 | for (i = 0; i < tp->md5sig_info->entries6; i++) | 659 | for (i = 0; i < tp->md5sig_info->entries6; i++) |
660 | kfree(tp->md5sig_info->keys6[i].key); | 660 | kfree(tp->md5sig_info->keys6[i].base.key); |
661 | tp->md5sig_info->entries6 = 0; | 661 | tp->md5sig_info->entries6 = 0; |
662 | tcp_free_md5sig_pool(); | 662 | tcp_free_md5sig_pool(); |
663 | } | 663 | } |
@@ -668,7 +668,7 @@ static void tcp_v6_clear_md5_list (struct sock *sk) | |||
668 | 668 | ||
669 | if (tp->md5sig_info->entries4) { | 669 | if (tp->md5sig_info->entries4) { |
670 | for (i = 0; i < tp->md5sig_info->entries4; i++) | 670 | for (i = 0; i < tp->md5sig_info->entries4; i++) |
671 | kfree(tp->md5sig_info->keys4[i].key); | 671 | kfree(tp->md5sig_info->keys4[i].base.key); |
672 | tp->md5sig_info->entries4 = 0; | 672 | tp->md5sig_info->entries4 = 0; |
673 | tcp_free_md5sig_pool(); | 673 | tcp_free_md5sig_pool(); |
674 | } | 674 | } |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 4210951edb6e..c347f3e30e2e 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -555,6 +555,8 @@ static int udp_v6_push_pending_frames(struct sock *sk) | |||
555 | out: | 555 | out: |
556 | up->len = 0; | 556 | up->len = 0; |
557 | up->pending = 0; | 557 | up->pending = 0; |
558 | if (!err) | ||
559 | UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, up->pcflag); | ||
558 | return err; | 560 | return err; |
559 | } | 561 | } |
560 | 562 | ||
@@ -823,10 +825,8 @@ do_append_data: | |||
823 | release_sock(sk); | 825 | release_sock(sk); |
824 | out: | 826 | out: |
825 | fl6_sock_release(flowlabel); | 827 | fl6_sock_release(flowlabel); |
826 | if (!err) { | 828 | if (!err) |
827 | UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS, is_udplite); | ||
828 | return len; | 829 | return len; |
829 | } | ||
830 | /* | 830 | /* |
831 | * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting | 831 | * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting |
832 | * ENOBUFS might not be good (it's not tunable per se), but otherwise | 832 | * ENOBUFS might not be good (it's not tunable per se), but otherwise |