diff options
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index d27c797f9f05..273f48d1df2e 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -347,7 +347,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
347 | */ | 347 | */ |
348 | v4addr = LOOPBACK4_IPV6; | 348 | v4addr = LOOPBACK4_IPV6; |
349 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { | 349 | if (!(addr_type & IPV6_ADDR_MULTICAST)) { |
350 | if (!inet->transparent && | 350 | if (!(inet->freebind || inet->transparent) && |
351 | !ipv6_chk_addr(net, &addr->sin6_addr, | 351 | !ipv6_chk_addr(net, &addr->sin6_addr, |
352 | dev, 0)) { | 352 | dev, 0)) { |
353 | err = -EADDRNOTAVAIL; | 353 | err = -EADDRNOTAVAIL; |
@@ -361,10 +361,10 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
361 | inet->inet_rcv_saddr = v4addr; | 361 | inet->inet_rcv_saddr = v4addr; |
362 | inet->inet_saddr = v4addr; | 362 | inet->inet_saddr = v4addr; |
363 | 363 | ||
364 | ipv6_addr_copy(&np->rcv_saddr, &addr->sin6_addr); | 364 | np->rcv_saddr = addr->sin6_addr; |
365 | 365 | ||
366 | if (!(addr_type & IPV6_ADDR_MULTICAST)) | 366 | if (!(addr_type & IPV6_ADDR_MULTICAST)) |
367 | ipv6_addr_copy(&np->saddr, &addr->sin6_addr); | 367 | np->saddr = addr->sin6_addr; |
368 | 368 | ||
369 | /* Make sure we are allowed to bind here. */ | 369 | /* Make sure we are allowed to bind here. */ |
370 | if (sk->sk_prot->get_port(sk, snum)) { | 370 | if (sk->sk_prot->get_port(sk, snum)) { |
@@ -458,14 +458,14 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, | |||
458 | peer == 1) | 458 | peer == 1) |
459 | return -ENOTCONN; | 459 | return -ENOTCONN; |
460 | sin->sin6_port = inet->inet_dport; | 460 | sin->sin6_port = inet->inet_dport; |
461 | ipv6_addr_copy(&sin->sin6_addr, &np->daddr); | 461 | sin->sin6_addr = np->daddr; |
462 | if (np->sndflow) | 462 | if (np->sndflow) |
463 | sin->sin6_flowinfo = np->flow_label; | 463 | sin->sin6_flowinfo = np->flow_label; |
464 | } else { | 464 | } else { |
465 | if (ipv6_addr_any(&np->rcv_saddr)) | 465 | if (ipv6_addr_any(&np->rcv_saddr)) |
466 | ipv6_addr_copy(&sin->sin6_addr, &np->saddr); | 466 | sin->sin6_addr = np->saddr; |
467 | else | 467 | else |
468 | ipv6_addr_copy(&sin->sin6_addr, &np->rcv_saddr); | 468 | sin->sin6_addr = np->rcv_saddr; |
469 | 469 | ||
470 | sin->sin6_port = inet->inet_sport; | 470 | sin->sin6_port = inet->inet_sport; |
471 | } | 471 | } |
@@ -660,8 +660,8 @@ int inet6_sk_rebuild_header(struct sock *sk) | |||
660 | 660 | ||
661 | memset(&fl6, 0, sizeof(fl6)); | 661 | memset(&fl6, 0, sizeof(fl6)); |
662 | fl6.flowi6_proto = sk->sk_protocol; | 662 | fl6.flowi6_proto = sk->sk_protocol; |
663 | ipv6_addr_copy(&fl6.daddr, &np->daddr); | 663 | fl6.daddr = np->daddr; |
664 | ipv6_addr_copy(&fl6.saddr, &np->saddr); | 664 | fl6.saddr = np->saddr; |
665 | fl6.flowlabel = np->flow_label; | 665 | fl6.flowlabel = np->flow_label; |
666 | fl6.flowi6_oif = sk->sk_bound_dev_if; | 666 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
667 | fl6.flowi6_mark = sk->sk_mark; | 667 | fl6.flowi6_mark = sk->sk_mark; |
@@ -769,7 +769,8 @@ out: | |||
769 | return err; | 769 | return err; |
770 | } | 770 | } |
771 | 771 | ||
772 | static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, u32 features) | 772 | static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, |
773 | netdev_features_t features) | ||
773 | { | 774 | { |
774 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 775 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
775 | struct ipv6hdr *ipv6h; | 776 | struct ipv6hdr *ipv6h; |
@@ -985,9 +986,9 @@ static int __net_init ipv6_init_mibs(struct net *net) | |||
985 | sizeof(struct icmpv6_mib), | 986 | sizeof(struct icmpv6_mib), |
986 | __alignof__(struct icmpv6_mib)) < 0) | 987 | __alignof__(struct icmpv6_mib)) < 0) |
987 | goto err_icmp_mib; | 988 | goto err_icmp_mib; |
988 | if (snmp_mib_init((void __percpu **)net->mib.icmpv6msg_statistics, | 989 | net->mib.icmpv6msg_statistics = kzalloc(sizeof(struct icmpv6msg_mib), |
989 | sizeof(struct icmpv6msg_mib), | 990 | GFP_KERNEL); |
990 | __alignof__(struct icmpv6msg_mib)) < 0) | 991 | if (!net->mib.icmpv6msg_statistics) |
991 | goto err_icmpmsg_mib; | 992 | goto err_icmpmsg_mib; |
992 | return 0; | 993 | return 0; |
993 | 994 | ||
@@ -1008,7 +1009,7 @@ static void ipv6_cleanup_mibs(struct net *net) | |||
1008 | snmp_mib_free((void __percpu **)net->mib.udplite_stats_in6); | 1009 | snmp_mib_free((void __percpu **)net->mib.udplite_stats_in6); |
1009 | snmp_mib_free((void __percpu **)net->mib.ipv6_statistics); | 1010 | snmp_mib_free((void __percpu **)net->mib.ipv6_statistics); |
1010 | snmp_mib_free((void __percpu **)net->mib.icmpv6_statistics); | 1011 | snmp_mib_free((void __percpu **)net->mib.icmpv6_statistics); |
1011 | snmp_mib_free((void __percpu **)net->mib.icmpv6msg_statistics); | 1012 | kfree(net->mib.icmpv6msg_statistics); |
1012 | } | 1013 | } |
1013 | 1014 | ||
1014 | static int __net_init inet6_net_init(struct net *net) | 1015 | static int __net_init inet6_net_init(struct net *net) |
@@ -1115,6 +1116,8 @@ static int __init inet6_init(void) | |||
1115 | if (err) | 1116 | if (err) |
1116 | goto static_sysctl_fail; | 1117 | goto static_sysctl_fail; |
1117 | #endif | 1118 | #endif |
1119 | tcpv6_prot.sysctl_mem = init_net.ipv4.sysctl_tcp_mem; | ||
1120 | |||
1118 | /* | 1121 | /* |
1119 | * ipngwg API draft makes clear that the correct semantics | 1122 | * ipngwg API draft makes clear that the correct semantics |
1120 | * for TCP and UDP is to consider one TCP and UDP instance | 1123 | * for TCP and UDP is to consider one TCP and UDP instance |