Home
last modified time | relevance | path

Searched refs:optlen (Results 1 – 25 of 103) sorted by relevance

12345

/net/ipv4/
Dip_options.c50 memcpy(iph + sizeof(struct iphdr), opt->__data, opt->optlen); in ip_options_build()
95 int optlen; in __ip_options_echo() local
99 if (sopt->optlen == 0) in __ip_options_echo()
106 optlen = sptr[sopt->rr+1]; in __ip_options_echo()
108 dopt->rr = dopt->optlen + sizeof(struct iphdr); in __ip_options_echo()
109 memcpy(dptr, sptr+sopt->rr, optlen); in __ip_options_echo()
110 if (sopt->rr_needaddr && soffset <= optlen) { in __ip_options_echo()
111 if (soffset + 3 > optlen) in __ip_options_echo()
116 dptr += optlen; in __ip_options_echo()
117 dopt->optlen += optlen; in __ip_options_echo()
[all …]
Dip_sockglue.c78 if (IPCB(skb)->opt.optlen == 0) in ip_cmsg_recv_opts()
81 put_cmsg(msg, SOL_IP, IP_RECVOPTS, IPCB(skb)->opt.optlen, in ip_cmsg_recv_opts()
92 if (IPCB(skb)->opt.optlen == 0) in ip_cmsg_recv_retopts()
101 put_cmsg(msg, SOL_IP, IP_RETOPTS, opt->optlen, opt->__data); in ip_cmsg_recv_retopts()
705 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument
710 if (optlen != sizeof(gr32)) in copy_group_source_from_sockptr()
718 if (optlen != sizeof(*greqs)) in copy_group_source_from_sockptr()
728 sockptr_t optval, int optlen) in do_mcast_group_source() argument
735 err = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_mcast_group_source()
775 static int ip_set_mcast_msfilter(struct sock *sk, sockptr_t optval, int optlen) in ip_set_mcast_msfilter() argument
[all …]
Draw.c586 sizeof(*inet_opt) + inet_opt->opt.optlen); in raw_sendmsg()
819 static int raw_seticmpfilter(struct sock *sk, sockptr_t optval, int optlen) in raw_seticmpfilter() argument
821 if (optlen > sizeof(struct icmp_filter)) in raw_seticmpfilter()
822 optlen = sizeof(struct icmp_filter); in raw_seticmpfilter()
823 if (copy_from_sockptr(&raw_sk(sk)->filter, optval, optlen)) in raw_seticmpfilter()
828 static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *optlen) in raw_geticmpfilter() argument
832 if (get_user(len, optlen)) in raw_geticmpfilter()
840 if (put_user(len, optlen) || in raw_geticmpfilter()
848 sockptr_t optval, unsigned int optlen) in do_raw_setsockopt() argument
854 return raw_seticmpfilter(sk, optval, optlen); in do_raw_setsockopt()
[all …]
Dfou.c121 size_t len, optlen, hdrlen; in gue_udp_recv() local
166 optlen = guehdr->hlen << 2; in gue_udp_recv()
167 len += optlen; in gue_udp_recv()
175 if (validate_gue_flags(guehdr, optlen)) in gue_udp_recv()
178 hdrlen = sizeof(struct guehdr) + optlen; in gue_udp_recv()
319 size_t len, optlen, hdrlen, off; in gue_gro_receive() local
358 optlen = guehdr->hlen << 2; in gue_gro_receive()
359 len += optlen; in gue_gro_receive()
368 validate_gue_flags(guehdr, optlen)) in gue_gro_receive()
371 hdrlen = sizeof(*guehdr) + optlen; in gue_gro_receive()
[all …]
Dcipso_ipv4.c1504 int optlen; in cipso_v4_optptr() local
1507 for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 1; ) { in cipso_v4_optptr()
1517 if (!taglen || taglen > optlen) in cipso_v4_optptr()
1522 optlen -= taglen; in cipso_v4_optptr()
1734 opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr); in cipso_v4_error()
1875 opt->opt.optlen = opt_len; in cipso_v4_sock_setattr()
1887 sk_conn->icsk_ext_hdr_len -= old->opt.optlen; in cipso_v4_sock_setattr()
1888 sk_conn->icsk_ext_hdr_len += opt->opt.optlen; in cipso_v4_sock_setattr()
1952 opt->opt.optlen = opt_len; in cipso_v4_req_setattr()
2009 opt->opt.optlen - cipso_off - cipso_len); in cipso_v4_delopt()
[all …]
/net/ipv6/
Dipv6_sockglue.c140 sockptr_t optval, int optlen) in copy_group_source_from_sockptr() argument
145 if (optlen < sizeof(gr32)) in copy_group_source_from_sockptr()
153 if (optlen < sizeof(*greqs)) in copy_group_source_from_sockptr()
163 sockptr_t optval, int optlen) in do_ipv6_mcast_group_source() argument
169 ret = copy_group_source_from_sockptr(&greqs, optval, optlen); in do_ipv6_mcast_group_source()
204 int optlen) in ipv6_set_mcast_msfilter() argument
209 if (optlen < GROUP_FILTER_SIZE(0)) in ipv6_set_mcast_msfilter()
211 if (optlen > READ_ONCE(sysctl_optmem_max)) in ipv6_set_mcast_msfilter()
214 gsf = memdup_sockptr(optval, optlen); in ipv6_set_mcast_msfilter()
225 if (GROUP_FILTER_SIZE(gsf->gf_numsrc) > optlen) in ipv6_set_mcast_msfilter()
[all …]
Dexthdrs_core.c136 int optlen; in ipv6_find_tlv() local
143 optlen = 1; in ipv6_find_tlv()
148 optlen = nh[offset + 1] + 2; in ipv6_find_tlv()
149 if (optlen > len) in ipv6_find_tlv()
153 offset += optlen; in ipv6_find_tlv()
154 len -= optlen; in ipv6_find_tlv()
Draw.c980 sockptr_t optval, int optlen) in rawv6_seticmpfilter() argument
984 if (optlen > sizeof(struct icmp6_filter)) in rawv6_seticmpfilter()
985 optlen = sizeof(struct icmp6_filter); in rawv6_seticmpfilter()
986 if (copy_from_sockptr(&raw6_sk(sk)->filter, optval, optlen)) in rawv6_seticmpfilter()
997 char __user *optval, int __user *optlen) in rawv6_geticmpfilter() argument
1003 if (get_user(len, optlen)) in rawv6_geticmpfilter()
1009 if (put_user(len, optlen)) in rawv6_geticmpfilter()
1023 sockptr_t optval, unsigned int optlen) in do_rawv6_setsockopt() argument
1028 if (optlen < sizeof(val)) in do_rawv6_setsockopt()
1073 sockptr_t optval, unsigned int optlen) in rawv6_setsockopt() argument
[all …]
Dah6.c110 int optlen = 0; in zero_out_mutable_opts() local
120 optlen = 1; in zero_out_mutable_opts()
125 optlen = opt[off+1]+2; in zero_out_mutable_opts()
126 if (len < optlen) in zero_out_mutable_opts()
133 off += optlen; in zero_out_mutable_opts()
134 len -= optlen; in zero_out_mutable_opts()
154 int optlen = 0; in ipv6_rearrange_destopt() local
164 optlen = 1; in ipv6_rearrange_destopt()
169 optlen = opt[off+1]+2; in ipv6_rearrange_destopt()
170 if (len < optlen) in ipv6_rearrange_destopt()
[all …]
/net/sctp/
Dsocket.c1391 int __user *optlen) in sctp_getsockopt_connectx3() argument
1428 if (put_user(sizeof(assoc_id), optlen)) in sctp_getsockopt_connectx3()
2211 unsigned int optlen) in sctp_setsockopt_disable_fragments() argument
2213 if (optlen < sizeof(int)) in sctp_setsockopt_disable_fragments()
2220 unsigned int optlen) in sctp_setsockopt_events() argument
2226 if (optlen > sizeof(struct sctp_event_subscribe)) in sctp_setsockopt_events()
2229 for (i = 0; i < optlen; i++) in sctp_setsockopt_events()
2269 unsigned int optlen) in sctp_setsockopt_autoclose() argument
2277 if (optlen != sizeof(int)) in sctp_setsockopt_autoclose()
2618 unsigned int optlen) in sctp_setsockopt_peer_addr_params() argument
[all …]
/net/mptcp/
Dsockopt.c56 unsigned int optlen, int *val) in mptcp_get_int_option() argument
58 if (optlen < sizeof(int)) in mptcp_get_int_option()
170 unsigned int optlen) in mptcp_setsockopt_sol_socket_int() argument
174 ret = mptcp_get_int_option(msk, optval, optlen, &val); in mptcp_setsockopt_sol_socket_int()
206 unsigned int optlen) in mptcp_setsockopt_sol_socket_timestamping() argument
213 if (optlen == sizeof(timestamping)) { in mptcp_setsockopt_sol_socket_timestamping()
217 } else if (optlen == sizeof(int)) { in mptcp_setsockopt_sol_socket_timestamping()
248 unsigned int optlen) in mptcp_setsockopt_sol_socket_linger() argument
256 if (optlen < sizeof(ling)) in mptcp_setsockopt_sol_socket_linger()
289 sockptr_t optval, unsigned int optlen) in mptcp_setsockopt_sol_socket() argument
[all …]
/net/dccp/
Dproto.c424 sockptr_t optval, unsigned int optlen) in dccp_setsockopt_service() argument
430 optlen > DCCP_SERVICE_LIST_MAX_LEN * sizeof(u32)) in dccp_setsockopt_service()
433 if (optlen > sizeof(service)) { in dccp_setsockopt_service()
434 sl = kmalloc(optlen, GFP_KERNEL); in dccp_setsockopt_service()
438 sl->dccpsl_nr = optlen / sizeof(u32) - 1; in dccp_setsockopt_service()
440 sizeof(service), optlen - sizeof(service)) || in dccp_setsockopt_service()
494 sockptr_t optval, unsigned int optlen) in dccp_setsockopt_ccid() argument
499 if (optlen < 1 || optlen > DCCP_FEAT_MAX_SP_VALS) in dccp_setsockopt_ccid()
502 val = memdup_sockptr(optval, optlen); in dccp_setsockopt_ccid()
508 rc = dccp_feat_register_sp(sk, DCCPF_CCID, 1, val, optlen); in dccp_setsockopt_ccid()
[all …]
Dccid.h81 int __user *optlen);
85 int __user *optlen);
243 u32 __user *optval, int __user *optlen) in ccid_hc_rx_getsockopt() argument
248 optval, optlen); in ccid_hc_rx_getsockopt()
254 u32 __user *optval, int __user *optlen) in ccid_hc_tx_getsockopt() argument
259 optval, optlen); in ccid_hc_tx_getsockopt()
/net/rds/
Daf_rds.c331 int optlen) in rds_set_bool_option() argument
335 if (optlen < sizeof(int)) in rds_set_bool_option()
343 static int rds_cong_monitor(struct rds_sock *rs, sockptr_t optval, int optlen) in rds_cong_monitor() argument
347 ret = rds_set_bool_option(&rs->rs_cong_monitor, optval, optlen); in rds_cong_monitor()
360 static int rds_set_transport(struct rds_sock *rs, sockptr_t optval, int optlen) in rds_set_transport() argument
367 if (optlen != sizeof(int)) in rds_set_transport()
382 int optlen, int optname) in rds_enable_recvtstamp() argument
386 if (optlen != sizeof(int)) in rds_enable_recvtstamp()
406 int optlen) in rds_recv_track_latency() argument
411 if (optlen != sizeof(struct rds_rx_trace_so)) in rds_recv_track_latency()
[all …]
/net/ipv6/netfilter/
Dip6t_hbh.c57 unsigned int optlen; in hbh_mt6() local
137 optlen = *lp + 2; in hbh_mt6()
140 optlen = 1; in hbh_mt6()
144 pr_debug("len%04X\n", optlen); in hbh_mt6()
146 if ((ptr > skb->len - optlen || hdrlen < optlen) && in hbh_mt6()
151 ptr += optlen; in hbh_mt6()
152 hdrlen -= optlen; in hbh_mt6()
/net/ipv4/bpfilter/
Dsockopt.c25 unsigned int optlen, bool is_set) in bpfilter_mbox_request() argument
48 err = bpfilter_ops.sockopt(sk, optname, optval, optlen, is_set); in bpfilter_mbox_request()
55 unsigned int optlen) in bpfilter_ip_set_sockopt() argument
57 return bpfilter_mbox_request(sk, optname, optval, optlen, true); in bpfilter_ip_set_sockopt()
61 int __user *optlen) in bpfilter_ip_get_sockopt() argument
65 if (get_user(len, optlen)) in bpfilter_ip_get_sockopt()
/net/netfilter/
Dxt_tcpmss.c33 unsigned int i, optlen; in tcpmss_mt() local
44 optlen = th->doff*4 - sizeof(*th); in tcpmss_mt()
45 if (!optlen) in tcpmss_mt()
49 op = skb_header_pointer(skb, par->thoff + sizeof(*th), optlen, _opt); in tcpmss_mt()
53 for (i = 0; i < optlen; ) { in tcpmss_mt()
55 && (optlen - i) >= TCPOLEN_MSS in tcpmss_mt()
Dxt_dccp.c43 unsigned int optlen = dh->dccph_doff*4 - __dccp_hdr_len(dh); in dccp_find_option() local
49 if (!optlen) in dccp_find_option()
53 op = skb_header_pointer(skb, protoff + optoff, optlen, dccp_optbuf); in dccp_find_option()
59 for (i = 0; i < optlen; ) { in dccp_find_option()
/net/can/
Draw.c525 sockptr_t optval, unsigned int optlen) in raw_setsockopt() argument
541 if (optlen % sizeof(struct can_filter) != 0) in raw_setsockopt()
544 if (optlen > CAN_RAW_FILTER_MAX * sizeof(struct can_filter)) in raw_setsockopt()
547 count = optlen / sizeof(struct can_filter); in raw_setsockopt()
551 filter = memdup_sockptr(optval, optlen); in raw_setsockopt()
611 if (optlen != sizeof(err_mask)) in raw_setsockopt()
614 if (copy_from_sockptr(&err_mask, optval, optlen)) in raw_setsockopt()
654 if (optlen != sizeof(ro->loopback)) in raw_setsockopt()
657 if (copy_from_sockptr(&ro->loopback, optval, optlen)) in raw_setsockopt()
663 if (optlen != sizeof(ro->recv_own_msgs)) in raw_setsockopt()
[all …]
/net/xfrm/
Dxfrm_output.c229 int hdrlen, optlen; in xfrm4_beet_encap_add() local
232 optlen = XFRM_MODE_SKB_CB(skb)->optlen; in xfrm4_beet_encap_add()
233 if (unlikely(optlen)) in xfrm4_beet_encap_add()
234 hdrlen += IPV4_BEET_PHMAXLEN - (optlen & 4); in xfrm4_beet_encap_add()
250 if (unlikely(optlen)) { in xfrm4_beet_encap_add()
251 if (WARN_ON(optlen < 0)) in xfrm4_beet_encap_add()
254 ph->padlen = 4 - (optlen & 4); in xfrm4_beet_encap_add()
255 ph->hdrlen = optlen / 8; in xfrm4_beet_encap_add()
359 int optlen, hdr_len; in xfrm6_beet_encap_add() local
362 optlen = XFRM_MODE_SKB_CB(skb)->optlen; in xfrm6_beet_encap_add()
[all …]
/net/tls/
Dtls_main.c337 int __user *optlen, int tx) in do_tls_getsockopt_conf() argument
345 if (get_user(len, optlen)) in do_tls_getsockopt_conf()
432 char __user *optval, int __user *optlen) in do_tls_getsockopt() argument
441 rc = do_tls_getsockopt_conf(sk, optval, optlen, in do_tls_getsockopt()
455 char __user *optval, int __user *optlen) in tls_getsockopt() argument
461 optname, optval, optlen); in tls_getsockopt()
463 return do_tls_getsockopt(sk, optname, optval, optlen); in tls_getsockopt()
467 unsigned int optlen, int tx) in do_tls_setsockopt_conf() argument
476 if (sockptr_is_null(optval) || (optlen < sizeof(*crypto_info))) { in do_tls_setsockopt_conf()
536 if (optlen != optsize) { in do_tls_setsockopt_conf()
[all …]
/net/rxrpc/
Dserver_key.c121 int rxrpc_server_keyring(struct rxrpc_sock *rx, sockptr_t optval, int optlen) in rxrpc_server_keyring() argument
128 if (optlen <= 0 || optlen > PAGE_SIZE - 1) in rxrpc_server_keyring()
131 description = memdup_sockptr_nul(optval, optlen); in rxrpc_server_keyring()
/net/bridge/
Dbr_netfilter_ipv6.c61 int optlen = nh[off + 1] + 2; in br_nf_check_hbh_len() local
65 optlen = 1; in br_nf_check_hbh_len()
86 if (optlen > len) in br_nf_check_hbh_len()
90 off += optlen; in br_nf_check_hbh_len()
91 len -= optlen; in br_nf_check_hbh_len()
/net/atm/
Dpvc.c66 sockptr_t optval, unsigned int optlen) in pvc_setsockopt() argument
72 error = vcc_setsockopt(sock, level, optname, optval, optlen); in pvc_setsockopt()
78 char __user *optval, int __user *optlen) in pvc_getsockopt() argument
84 error = vcc_getsockopt(sock, level, optname, optval, optlen); in pvc_getsockopt()
/net/can/j1939/
Dsocket.c664 unsigned int optlen, int flag) in j1939_sk_setsockopt_flag() argument
668 if (optlen != sizeof(tmp)) in j1939_sk_setsockopt_flag()
670 if (copy_from_sockptr(&tmp, optval, optlen)) in j1939_sk_setsockopt_flag()
682 sockptr_t optval, unsigned int optlen) in j1939_sk_setsockopt() argument
694 if (!sockptr_is_null(optval) && optlen != 0) { in j1939_sk_setsockopt()
698 if (optlen % sizeof(*filters) != 0) in j1939_sk_setsockopt()
701 if (optlen > J1939_FILTER_MAX * in j1939_sk_setsockopt()
705 count = optlen / sizeof(*filters); in j1939_sk_setsockopt()
706 filters = memdup_sockptr(optval, optlen); in j1939_sk_setsockopt()
727 return j1939_sk_setsockopt_flag(jsk, optval, optlen, in j1939_sk_setsockopt()
[all …]

12345