aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r--net/ipv6/ipv6_sockglue.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 4f7aaf6996a3..33f60fca7aa7 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -36,6 +36,7 @@
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/sysctl.h> 37#include <linux/sysctl.h>
38#include <linux/netfilter.h> 38#include <linux/netfilter.h>
39#include <linux/slab.h>
39 40
40#include <net/sock.h> 41#include <net/sock.h>
41#include <net/snmp.h> 42#include <net/snmp.h>
@@ -64,7 +65,7 @@ int ip6_ra_control(struct sock *sk, int sel)
64 struct ip6_ra_chain *ra, *new_ra, **rap; 65 struct ip6_ra_chain *ra, *new_ra, **rap;
65 66
66 /* RA packet may be delivered ONLY to IPPROTO_RAW socket */ 67 /* RA packet may be delivered ONLY to IPPROTO_RAW socket */
67 if (sk->sk_type != SOCK_RAW || inet_sk(sk)->num != IPPROTO_RAW) 68 if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num != IPPROTO_RAW)
68 return -ENOPROTOOPT; 69 return -ENOPROTOOPT;
69 70
70 new_ra = (sel>=0) ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL; 71 new_ra = (sel>=0) ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL;
@@ -106,7 +107,7 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk,
106 if (inet_sk(sk)->is_icsk) { 107 if (inet_sk(sk)->is_icsk) {
107 if (opt && 108 if (opt &&
108 !((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) && 109 !((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) &&
109 inet_sk(sk)->daddr != LOOPBACK4_IPV6) { 110 inet_sk(sk)->inet_daddr != LOOPBACK4_IPV6) {
110 struct inet_connection_sock *icsk = inet_csk(sk); 111 struct inet_connection_sock *icsk = inet_csk(sk);
111 icsk->icsk_ext_hdr_len = opt->opt_flen + opt->opt_nflen; 112 icsk->icsk_ext_hdr_len = opt->opt_flen + opt->opt_nflen;
112 icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); 113 icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie);
@@ -234,7 +235,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
234 235
235 case IPV6_V6ONLY: 236 case IPV6_V6ONLY:
236 if (optlen < sizeof(int) || 237 if (optlen < sizeof(int) ||
237 inet_sk(sk)->num) 238 inet_sk(sk)->inet_num)
238 goto e_inval; 239 goto e_inval;
239 np->ipv6only = valbool; 240 np->ipv6only = valbool;
240 retv = 0; 241 retv = 0;
@@ -424,6 +425,7 @@ sticky_done:
424 425
425 fl.fl6_flowlabel = 0; 426 fl.fl6_flowlabel = 0;
426 fl.oif = sk->sk_bound_dev_if; 427 fl.oif = sk->sk_bound_dev_if;
428 fl.mark = sk->sk_mark;
427 429
428 if (optlen == 0) 430 if (optlen == 0)
429 goto update; 431 goto update;
@@ -665,7 +667,7 @@ done:
665 case IPV6_MTU_DISCOVER: 667 case IPV6_MTU_DISCOVER:
666 if (optlen < sizeof(int)) 668 if (optlen < sizeof(int))
667 goto e_inval; 669 goto e_inval;
668 if (val<0 || val>3) 670 if (val < IP_PMTUDISC_DONT || val > IP_PMTUDISC_PROBE)
669 goto e_inval; 671 goto e_inval;
670 np->pmtudisc = val; 672 np->pmtudisc = val;
671 retv = 0; 673 retv = 0;