Lines Matching refs:optname
120 static bool setsockopt_needs_rtnl(int optname) in setsockopt_needs_rtnl() argument
122 switch (optname) { in setsockopt_needs_rtnl()
163 static int do_ipv6_mcast_group_source(struct sock *sk, int optname, in do_ipv6_mcast_group_source() argument
178 if (optname == MCAST_BLOCK_SOURCE) { in do_ipv6_mcast_group_source()
181 } else if (optname == MCAST_UNBLOCK_SOURCE) { in do_ipv6_mcast_group_source()
184 } else if (optname == MCAST_JOIN_SOURCE_GROUP) { in do_ipv6_mcast_group_source()
279 static int ipv6_mcast_join_leave(struct sock *sk, int optname, in ipv6_mcast_join_leave() argument
293 if (optname == MCAST_JOIN_GROUP) in ipv6_mcast_join_leave()
299 static int compat_ipv6_mcast_join_leave(struct sock *sk, int optname, in compat_ipv6_mcast_join_leave() argument
313 if (optname == MCAST_JOIN_GROUP) in compat_ipv6_mcast_join_leave()
319 static int ipv6_set_opt_hdr(struct sock *sk, int optname, sockptr_t optval, in ipv6_set_opt_hdr() argument
329 if (optname != IPV6_RTHDR && !sockopt_ns_capable(net->user_ns, CAP_NET_RAW)) in ipv6_set_opt_hdr()
353 opt = ipv6_renew_options(sk, opt, optname, new); in ipv6_set_opt_hdr()
360 if (optname == IPV6_RTHDR && opt && opt->srcrt) { in ipv6_set_opt_hdr()
393 int do_ipv6_setsockopt(struct sock *sk, int level, int optname, in do_ipv6_setsockopt() argument
400 bool needs_rtnl = setsockopt_needs_rtnl(optname); in do_ipv6_setsockopt()
414 if (ip6_mroute_opt(optname)) in do_ipv6_setsockopt()
415 return ip6_mroute_setsockopt(sk, optname, optval, optlen); in do_ipv6_setsockopt()
427 switch (optname) { in do_ipv6_setsockopt()
658 retv = ipv6_set_opt_hdr(sk, optname, optval, optlen); in do_ipv6_setsockopt()
840 if (optname == IPV6_ADD_MEMBERSHIP) in do_ipv6_setsockopt()
858 if (optname == IPV6_JOIN_ANYCAST) in do_ipv6_setsockopt()
874 retv = compat_ipv6_mcast_join_leave(sk, optname, optval, in do_ipv6_setsockopt()
877 retv = ipv6_mcast_join_leave(sk, optname, optval, in do_ipv6_setsockopt()
884 retv = do_ipv6_mcast_group_source(sk, optname, optval, optlen); in do_ipv6_setsockopt()
942 retv = xfrm_user_policy(sk, optname, optval, optlen); in do_ipv6_setsockopt()
1000 int ipv6_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, in ipv6_setsockopt() argument
1006 return udp_prot.setsockopt(sk, level, optname, optval, optlen); in ipv6_setsockopt()
1011 err = do_ipv6_setsockopt(sk, level, optname, optval, optlen); in ipv6_setsockopt()
1014 if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY && in ipv6_setsockopt()
1015 optname != IPV6_XFRM_POLICY) in ipv6_setsockopt()
1016 err = nf_setsockopt(sk, PF_INET6, optname, optval, optlen); in ipv6_setsockopt()
1023 int optname, sockptr_t optval, int len) in ipv6_getsockopt_sticky() argument
1030 switch (optname) { in ipv6_getsockopt_sticky()
1124 int do_ipv6_getsockopt(struct sock *sk, int level, int optname, in do_ipv6_getsockopt() argument
1131 if (ip6_mroute_opt(optname)) in do_ipv6_getsockopt()
1132 return ip6_mroute_getsockopt(sk, optname, optval, optlen); in do_ipv6_getsockopt()
1136 switch (optname) { in do_ipv6_getsockopt()
1264 len = ipv6_getsockopt_sticky(sk, opt, optname, optval, len); in do_ipv6_getsockopt()
1348 if (optname == IPV6_UNICAST_HOPS) in do_ipv6_getsockopt()
1478 int ipv6_getsockopt(struct sock *sk, int level, int optname, in ipv6_getsockopt() argument
1484 return udp_prot.getsockopt(sk, level, optname, optval, optlen); in ipv6_getsockopt()
1489 err = do_ipv6_getsockopt(sk, level, optname, in ipv6_getsockopt()
1493 if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { in ipv6_getsockopt()
1499 err = nf_getsockopt(sk, PF_INET6, optname, optval, &len); in ipv6_getsockopt()