diff options
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 7de52b65173f..44bb66bde0e2 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -197,6 +197,7 @@ lookup_protocol: | |||
197 | np->mcast_hops = IPV6_DEFAULT_MCASTHOPS; | 197 | np->mcast_hops = IPV6_DEFAULT_MCASTHOPS; |
198 | np->mc_loop = 1; | 198 | np->mc_loop = 1; |
199 | np->pmtudisc = IPV6_PMTUDISC_WANT; | 199 | np->pmtudisc = IPV6_PMTUDISC_WANT; |
200 | np->autoflowlabel = ip6_default_np_autolabel(sock_net(sk)); | ||
200 | sk->sk_ipv6only = net->ipv6.sysctl.bindv6only; | 201 | sk->sk_ipv6only = net->ipv6.sysctl.bindv6only; |
201 | 202 | ||
202 | /* Init the ipv4 part of the socket since we can have sockets | 203 | /* Init the ipv4 part of the socket since we can have sockets |
@@ -342,7 +343,8 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
342 | */ | 343 | */ |
343 | v4addr = LOOPBACK4_IPV6; | 344 | v4addr = LOOPBACK4_IPV6; |
344 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { | 345 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { |
345 | if (!(inet->freebind || inet->transparent) && | 346 | if (!net->ipv6.sysctl.ip_nonlocal_bind && |
347 | !(inet->freebind || inet->transparent) && | ||
346 | !ipv6_chk_addr(net, &addr->sin6_addr, | 348 | !ipv6_chk_addr(net, &addr->sin6_addr, |
347 | dev, 0)) { | 349 | dev, 0)) { |
348 | err = -EADDRNOTAVAIL; | 350 | err = -EADDRNOTAVAIL; |
@@ -679,8 +681,8 @@ bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb, | |||
679 | const struct ipv6_pinfo *np = inet6_sk(sk); | 681 | const struct ipv6_pinfo *np = inet6_sk(sk); |
680 | 682 | ||
681 | if (np->rxopt.all) { | 683 | if (np->rxopt.all) { |
682 | if ((opt->hop && (np->rxopt.bits.hopopts || | 684 | if (((opt->flags & IP6SKB_HOPBYHOP) && |
683 | np->rxopt.bits.ohopopts)) || | 685 | (np->rxopt.bits.hopopts || np->rxopt.bits.ohopopts)) || |
684 | (ip6_flowinfo((struct ipv6hdr *) skb_network_header(skb)) && | 686 | (ip6_flowinfo((struct ipv6hdr *) skb_network_header(skb)) && |
685 | np->rxopt.bits.rxflow) || | 687 | np->rxopt.bits.rxflow) || |
686 | (opt->srcrt && (np->rxopt.bits.srcrt || | 688 | (opt->srcrt && (np->rxopt.bits.srcrt || |
@@ -766,10 +768,10 @@ static int __net_init inet6_net_init(struct net *net) | |||
766 | net->ipv6.sysctl.bindv6only = 0; | 768 | net->ipv6.sysctl.bindv6only = 0; |
767 | net->ipv6.sysctl.icmpv6_time = 1*HZ; | 769 | net->ipv6.sysctl.icmpv6_time = 1*HZ; |
768 | net->ipv6.sysctl.flowlabel_consistency = 1; | 770 | net->ipv6.sysctl.flowlabel_consistency = 1; |
769 | net->ipv6.sysctl.auto_flowlabels = 0; | 771 | net->ipv6.sysctl.auto_flowlabels = IP6_DEFAULT_AUTO_FLOW_LABELS; |
770 | net->ipv6.sysctl.idgen_retries = 3; | 772 | net->ipv6.sysctl.idgen_retries = 3; |
771 | net->ipv6.sysctl.idgen_delay = 1 * HZ; | 773 | net->ipv6.sysctl.idgen_delay = 1 * HZ; |
772 | net->ipv6.sysctl.flowlabel_state_ranges = 1; | 774 | net->ipv6.sysctl.flowlabel_state_ranges = 0; |
773 | atomic_set(&net->ipv6.fib6_sernum, 1); | 775 | atomic_set(&net->ipv6.fib6_sernum, 1); |
774 | 776 | ||
775 | err = ipv6_init_mibs(net); | 777 | err = ipv6_init_mibs(net); |