Lines Matching refs:optlen
141 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument
146 if (optlen < sizeof(gr32)) in copy_group_source_from_sockptr()
154 if (optlen < sizeof(*greqs)) in copy_group_source_from_sockptr()
164 sockptr_t optval, int optlen) in do_ipv6_mcast_group_source() argument
170 ret = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_ipv6_mcast_group_source()
205 int optlen) in ipv6_set_mcast_msfilter() argument
210 if (optlen < GROUP_FILTER_SIZE(0)) in ipv6_set_mcast_msfilter()
212 if (optlen > READ_ONCE(sock_net(sk)->core.sysctl_optmem_max)) in ipv6_set_mcast_msfilter()
215 gsf = memdup_sockptr(optval, optlen); in ipv6_set_mcast_msfilter()
226 if (GROUP_FILTER_SIZE(gsf->gf_numsrc) > optlen) in ipv6_set_mcast_msfilter()
236 int optlen) in compat_ipv6_set_mcast_msfilter() argument
244 if (optlen < size0) in compat_ipv6_set_mcast_msfilter()
246 if (optlen > READ_ONCE(sock_net(sk)->core.sysctl_optmem_max) - 4) in compat_ipv6_set_mcast_msfilter()
249 p = kmalloc(optlen + 4, GFP_KERNEL); in compat_ipv6_set_mcast_msfilter()
255 if (copy_from_sockptr(gf32, optval, optlen)) in compat_ipv6_set_mcast_msfilter()
265 if (offsetof(struct compat_group_filter, gf_slist_flex[n]) > optlen) in compat_ipv6_set_mcast_msfilter()
280 sockptr_t optval, int optlen) in ipv6_mcast_join_leave() argument
285 if (optlen < sizeof(greq)) in ipv6_mcast_join_leave()
300 sockptr_t optval, int optlen) in compat_ipv6_mcast_join_leave() argument
305 if (optlen < sizeof(gr32)) in compat_ipv6_mcast_join_leave()
320 int optlen) in ipv6_set_opt_hdr() argument
335 if (optlen > 0) { in ipv6_set_opt_hdr()
338 if (optlen < sizeof(struct ipv6_opt_hdr) || in ipv6_set_opt_hdr()
339 optlen & 0x7 || in ipv6_set_opt_hdr()
340 optlen > 8 * 255) in ipv6_set_opt_hdr()
343 new = memdup_sockptr(optval, optlen); in ipv6_set_opt_hdr()
346 if (unlikely(ipv6_optlen(new) > optlen)) { in ipv6_set_opt_hdr()
374 if (!seg6_validate_srh(srh, optlen, false)) in ipv6_set_opt_hdr()
394 sockptr_t optval, unsigned int optlen) in do_ipv6_setsockopt() argument
405 if (optlen >= sizeof(int)) { in do_ipv6_setsockopt()
415 return ip6_mroute_setsockopt(sk, optname, optval, optlen); in do_ipv6_setsockopt()
420 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
427 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
436 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
444 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
451 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
465 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
472 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
484 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
491 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
496 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
503 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
508 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
514 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
544 if (optlen != sizeof(int)) in do_ipv6_setsockopt()
578 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
657 if (optlen < sizeof(int) || in do_ipv6_setsockopt()
665 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
672 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
679 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
686 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
693 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
700 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
707 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
714 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
721 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
728 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
735 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
754 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
761 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
768 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
780 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
788 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
796 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
806 retv = ipv6_set_opt_hdr(sk, optname, optval, optlen); in do_ipv6_setsockopt()
813 if (optlen == 0) in do_ipv6_setsockopt()
815 else if (optlen < sizeof(struct in6_pktinfo) || in do_ipv6_setsockopt()
843 if (optlen == 0) in do_ipv6_setsockopt()
850 if (optlen > 64*1024) in do_ipv6_setsockopt()
853 opt = sock_kmalloc(sk, sizeof(*opt) + optlen, GFP_KERNEL); in do_ipv6_setsockopt()
860 opt->tot_len = sizeof(*opt) + optlen; in do_ipv6_setsockopt()
862 if (copy_from_sockptr(opt + 1, optval, optlen)) in do_ipv6_setsockopt()
865 msg.msg_controllen = optlen; in do_ipv6_setsockopt()
889 if (optlen < sizeof(struct ipv6_mreq)) in do_ipv6_setsockopt()
911 if (optlen < sizeof(struct ipv6_mreq)) in do_ipv6_setsockopt()
928 optlen); in do_ipv6_setsockopt()
931 optlen); in do_ipv6_setsockopt()
937 retv = do_ipv6_mcast_group_source(sk, optname, optval, optlen); in do_ipv6_setsockopt()
942 optlen); in do_ipv6_setsockopt()
944 retv = ipv6_set_mcast_msfilter(sk, optval, optlen); in do_ipv6_setsockopt()
947 if (optlen < sizeof(int)) in do_ipv6_setsockopt()
954 retv = ipv6_flowlabel_opt(sk, optval, optlen); in do_ipv6_setsockopt()
961 retv = xfrm_user_policy(sk, optname, optval, optlen); in do_ipv6_setsockopt()
983 unsigned int optlen) in ipv6_setsockopt() argument
988 return ip_setsockopt(sk, level, optname, optval, optlen); in ipv6_setsockopt()
993 err = do_ipv6_setsockopt(sk, level, optname, optval, optlen); in ipv6_setsockopt()
998 err = nf_setsockopt(sk, PF_INET6, optname, optval, optlen); in ipv6_setsockopt()
1039 sockptr_t optlen, int len) in ipv6_get_msfilter() argument
1059 if (copy_to_sockptr(optlen, &len, sizeof(int)) || in ipv6_get_msfilter()
1068 sockptr_t optlen, int len) in compat_ipv6_get_msfilter() argument
1097 if (copy_to_sockptr(optlen, &len, sizeof(int)) || in compat_ipv6_get_msfilter()
1107 sockptr_t optval, sockptr_t optlen) in do_ipv6_getsockopt() argument
1114 return ip6_mroute_getsockopt(sk, optname, optval, optlen); in do_ipv6_getsockopt()
1116 if (copy_from_sockptr(&len, optlen, sizeof(int))) in do_ipv6_getsockopt()
1130 return compat_ipv6_get_msfilter(sk, optval, optlen, len); in do_ipv6_getsockopt()
1131 return ipv6_get_msfilter(sk, optval, optlen, len); in do_ipv6_getsockopt()
1197 return copy_to_sockptr(optlen, &len, sizeof(int)); in do_ipv6_getsockopt()
1257 return copy_to_sockptr(optlen, &len, sizeof(int)); in do_ipv6_getsockopt()
1311 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ipv6_getsockopt()
1405 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ipv6_getsockopt()
1465 if (copy_to_sockptr(optlen, &len, sizeof(int))) in do_ipv6_getsockopt()
1473 char __user *optval, int __user *optlen) in ipv6_getsockopt() argument
1478 return ip_getsockopt(sk, level, optname, optval, optlen); in ipv6_getsockopt()
1484 USER_SOCKPTR(optval), USER_SOCKPTR(optlen)); in ipv6_getsockopt()
1490 if (get_user(len, optlen)) in ipv6_getsockopt()
1495 err = put_user(len, optlen); in ipv6_getsockopt()