Lines Matching refs:optlen

76 	if (IPCB(skb)->opt.optlen == 0)  in ip_cmsg_recv_opts()
79 put_cmsg(msg, SOL_IP, IP_RECVOPTS, IPCB(skb)->opt.optlen, in ip_cmsg_recv_opts()
90 if (IPCB(skb)->opt.optlen == 0) in ip_cmsg_recv_retopts()
99 put_cmsg(msg, SOL_IP, IP_RETOPTS, opt->optlen, opt->__data); in ip_cmsg_recv_retopts()
699 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument
704 if (optlen != sizeof(gr32)) in copy_group_source_from_sockptr()
712 if (optlen != sizeof(*greqs)) in copy_group_source_from_sockptr()
722 sockptr_t optval, int optlen) in do_mcast_group_source() argument
729 err = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_mcast_group_source()
769 static int ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, int optlen) in ip_set_mcast_msfilter() argument
774 if (optlen < GROUP_FILTER_SIZE(0)) in ip_set_mcast_msfilter()
776 if (optlen > READ_ONCE(sock_net(sk)->core.sysctl_optmem_max)) in ip_set_mcast_msfilter()
779 gsf = memdup_sockptr(optval, optlen); in ip_set_mcast_msfilter()
790 if (GROUP_FILTER_SIZE(gsf->gf_numsrc) > optlen) in ip_set_mcast_msfilter()
802 int optlen) in compat_ip_set_mcast_msfilter() argument
810 if (optlen < size0) in compat_ip_set_mcast_msfilter()
812 if (optlen > READ_ONCE(sock_net(sk)->core.sysctl_optmem_max) - 4) in compat_ip_set_mcast_msfilter()
815 p = kmalloc(optlen + 4, GFP_KERNEL); in compat_ip_set_mcast_msfilter()
821 if (copy_from_sockptr(gf32, optval, optlen)) in compat_ip_set_mcast_msfilter()
831 if (offsetof(struct compat_group_filter, gf_slist_flex[n]) > optlen) in compat_ip_set_mcast_msfilter()
846 sockptr_t optval, int optlen) in ip_mcast_join_leave() argument
852 if (optlen < sizeof(struct group_req)) in ip_mcast_join_leave()
868 sockptr_t optval, int optlen) in compat_ip_mcast_join_leave() argument
874 if (optlen < sizeof(struct compat_group_req)) in compat_ip_mcast_join_leave()
893 sockptr_t optval, unsigned int optlen) in do_ip_setsockopt() argument
927 if (optlen >= sizeof(int)) { in do_ip_setsockopt()
930 } else if (optlen >= sizeof(char)) { in do_ip_setsockopt()
948 return ip_mroute_setsockopt(sk, optname, optval, optlen); in do_ip_setsockopt()
989 if (optlen < 1) in do_ip_setsockopt()
999 if (optlen < 1) in do_ip_setsockopt()
1004 if (optlen < 1) in do_ip_setsockopt()
1014 if (optlen < 1) in do_ip_setsockopt()
1027 if (optlen < 1) in do_ip_setsockopt()
1034 if (optlen < 1) in do_ip_setsockopt()
1047 if (optlen < 1) in do_ip_setsockopt()
1065 if (optlen != sizeof(u32)) in do_ip_setsockopt()
1085 if (optlen > 40) in do_ip_setsockopt()
1087 err = ip_options_get(sock_net(sk), &opt, optval, optlen); in do_ip_setsockopt()
1101 icsk->icsk_ext_hdr_len -= old->opt.optlen; in do_ip_setsockopt()
1103 icsk->icsk_ext_hdr_len += opt->opt.optlen; in do_ip_setsockopt()
1133 if (optlen != sizeof(int)) in do_ip_setsockopt()
1171 if (optlen < sizeof(struct in_addr)) in do_ip_setsockopt()
1175 if (optlen >= sizeof(struct ip_mreqn)) { in do_ip_setsockopt()
1180 if (optlen >= sizeof(struct ip_mreq)) { in do_ip_setsockopt()
1184 } else if (optlen >= sizeof(struct in_addr)) { in do_ip_setsockopt()
1234 if (optlen < sizeof(struct ip_mreq)) in do_ip_setsockopt()
1237 if (optlen >= sizeof(struct ip_mreqn)) { in do_ip_setsockopt()
1257 if (optlen < IP_MSFILTER_SIZE(0)) in do_ip_setsockopt()
1259 if (optlen > READ_ONCE(net->core.sysctl_optmem_max)) { in do_ip_setsockopt()
1263 msf = memdup_sockptr(optval, optlen); in do_ip_setsockopt()
1275 if (IP_MSFILTER_SIZE(msf->imsf_numsrc) > optlen) { in do_ip_setsockopt()
1292 if (optlen != sizeof(struct ip_mreq_source)) in do_ip_setsockopt()
1326 optlen); in do_ip_setsockopt()
1328 err = ip_mcast_join_leave(sk, optname, optval, optlen); in do_ip_setsockopt()
1334 err = do_mcast_group_source(sk, optname, optval, optlen); in do_ip_setsockopt()
1338 err = compat_ip_set_mcast_msfilter(sk, optval, optlen); in do_ip_setsockopt()
1340 err = ip_set_mcast_msfilter(sk, optval, optlen); in do_ip_setsockopt()
1347 err = xfrm_user_policy(sk, optname, optval, optlen); in do_ip_setsockopt()
1410 unsigned int optlen) in ip_setsockopt() argument
1417 err = do_ip_setsockopt(sk, level, optname, optval, optlen); in ip_setsockopt()
1424 err = nf_setsockopt(sk, PF_INET, optname, optval, optlen); in ip_setsockopt()
1446 sockptr_t optlen, int len) in ip_get_mcast_msfilter() argument
1466 if (copy_to_sockptr(optlen, &gsf_size, sizeof(int)) || in ip_get_mcast_msfilter()
1473 sockptr_t optlen, int len) in compat_ip_get_mcast_msfilter() argument
1498 if (copy_to_sockptr(optlen, &len, sizeof(int)) || in compat_ip_get_mcast_msfilter()
1508 sockptr_t optval, sockptr_t optlen) in do_ip_getsockopt() argument
1519 return ip_mroute_getsockopt(sk, optname, optval, optlen); in do_ip_getsockopt()
1521 if (copy_from_sockptr(&len, optlen, sizeof(int))) in do_ip_getsockopt()
1610 opt->optlen = 0; in do_ip_getsockopt()
1614 inet_opt->opt.optlen); in do_ip_getsockopt()
1617 if (opt->optlen == 0) { in do_ip_getsockopt()
1619 return copy_to_sockptr(optlen, &len, sizeof(int)); in do_ip_getsockopt()
1624 len = min_t(unsigned int, len, opt->optlen); in do_ip_getsockopt()
1625 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ip_getsockopt()
1679 return copy_to_sockptr(optlen, &len, sizeof(int)); in do_ip_getsockopt()
1690 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ip_getsockopt()
1718 err = ip_mc_msfget(sk, &msf, optval, optlen); in do_ip_getsockopt()
1723 err = compat_ip_get_mcast_msfilter(sk, optval, optlen, in do_ip_getsockopt()
1726 err = ip_get_mcast_msfilter(sk, optval, optlen, len); in do_ip_getsockopt()
1740 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ip_getsockopt()
1746 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ip_getsockopt()
1761 int optname, char __user *optval, int __user *optlen) in ip_getsockopt() argument
1766 USER_SOCKPTR(optval), USER_SOCKPTR(optlen)); in ip_getsockopt()
1774 if (get_user(len, optlen)) in ip_getsockopt()
1779 err = put_user(len, optlen); in ip_getsockopt()