Lines Matching refs:optname
639 static bool setsockopt_needs_rtnl(int optname) in setsockopt_needs_rtnl() argument
641 switch (optname) { in setsockopt_needs_rtnl()
720 static int do_mcast_group_source(struct sock *sk, int optname, in do_mcast_group_source() argument
742 if (optname == MCAST_BLOCK_SOURCE) { in do_mcast_group_source()
745 } else if (optname == MCAST_UNBLOCK_SOURCE) { in do_mcast_group_source()
748 } else if (optname == MCAST_JOIN_SOURCE_GROUP) { in do_mcast_group_source()
844 static int ip_mcast_join_leave(struct sock *sk, int optname, in ip_mcast_join_leave() argument
861 if (optname == MCAST_JOIN_GROUP) in ip_mcast_join_leave()
866 static int compat_ip_mcast_join_leave(struct sock *sk, int optname, in compat_ip_mcast_join_leave() argument
884 if (optname == MCAST_JOIN_GROUP) in compat_ip_mcast_join_leave()
891 static int do_ip_setsockopt(struct sock *sk, int level, int optname, in do_ip_setsockopt() argument
897 bool needs_rtnl = setsockopt_needs_rtnl(optname); in do_ip_setsockopt()
899 switch (optname) { in do_ip_setsockopt()
939 if (optname == IP_ROUTER_ALERT) in do_ip_setsockopt()
941 if (ip_mroute_opt(optname)) in do_ip_setsockopt()
942 return ip_mroute_setsockopt(sk, optname, optval, optlen); in do_ip_setsockopt()
949 switch (optname) { in do_ip_setsockopt()
1224 if (optname == IP_ADD_MEMBERSHIP) in do_ip_setsockopt()
1275 if (optname == IP_BLOCK_SOURCE) { in do_ip_setsockopt()
1278 } else if (optname == IP_UNBLOCK_SOURCE) { in do_ip_setsockopt()
1281 } else if (optname == IP_ADD_SOURCE_MEMBERSHIP) { in do_ip_setsockopt()
1302 err = compat_ip_mcast_join_leave(sk, optname, optval, in do_ip_setsockopt()
1305 err = ip_mcast_join_leave(sk, optname, optval, optlen); in do_ip_setsockopt()
1311 err = do_mcast_group_source(sk, optname, optval, optlen); in do_ip_setsockopt()
1338 err = xfrm_user_policy(sk, optname, optval, optlen); in do_ip_setsockopt()
1424 int ip_setsockopt(struct sock *sk, int level, int optname, sockptr_t optval, in ip_setsockopt() argument
1432 err = do_ip_setsockopt(sk, level, optname, optval, optlen); in ip_setsockopt()
1434 if (optname >= BPFILTER_IPT_SO_SET_REPLACE && in ip_setsockopt()
1435 optname < BPFILTER_IPT_SET_MAX) in ip_setsockopt()
1436 err = bpfilter_ip_set_sockopt(sk, optname, optval, optlen); in ip_setsockopt()
1440 if (err == -ENOPROTOOPT && optname != IP_HDRINCL && in ip_setsockopt()
1441 optname != IP_IPSEC_POLICY && in ip_setsockopt()
1442 optname != IP_XFRM_POLICY && in ip_setsockopt()
1443 !ip_mroute_opt(optname)) in ip_setsockopt()
1444 err = nf_setsockopt(sk, PF_INET, optname, optval, optlen); in ip_setsockopt()
1455 static bool getsockopt_needs_rtnl(int optname) in getsockopt_needs_rtnl() argument
1457 switch (optname) { in getsockopt_needs_rtnl()
1524 static int do_ip_getsockopt(struct sock *sk, int level, int optname, in do_ip_getsockopt() argument
1528 bool needs_rtnl = getsockopt_needs_rtnl(optname); in do_ip_getsockopt()
1535 if (ip_mroute_opt(optname)) in do_ip_getsockopt()
1536 return ip_mroute_getsockopt(sk, optname, optval, optlen); in do_ip_getsockopt()
1547 switch (optname) { in do_ip_getsockopt()
1766 int optname, char __user *optval, int __user *optlen) in ip_getsockopt() argument
1770 err = do_ip_getsockopt(sk, level, optname, optval, optlen); in ip_getsockopt()
1773 if (optname >= BPFILTER_IPT_SO_GET_INFO && in ip_getsockopt()
1774 optname < BPFILTER_IPT_GET_MAX) in ip_getsockopt()
1775 err = bpfilter_ip_get_sockopt(sk, optname, optval, optlen); in ip_getsockopt()
1779 if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS && in ip_getsockopt()
1780 !ip_mroute_opt(optname)) { in ip_getsockopt()
1786 err = nf_getsockopt(sk, PF_INET, optname, optval, &len); in ip_getsockopt()