Lines Matching refs:opt
1558 unsigned char *opt = *option; in cipso_v4_validate() local
1568 opt_len = opt[1]; in cipso_v4_validate()
1575 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2])); in cipso_v4_validate()
1582 tag = opt + opt_iter; in cipso_v4_validate()
1695 *option = opt + err_offset; in cipso_v4_validate()
1729 struct ip_options *opt = (struct ip_options *)optbuf; in cipso_v4_error() local
1740 memset(opt, 0, sizeof(struct ip_options)); in cipso_v4_error()
1741 opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr); in cipso_v4_error()
1743 res = __ip_options_compile(dev_net(skb->dev), opt, skb, NULL); in cipso_v4_error()
1750 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0, opt); in cipso_v4_error()
1752 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0, opt); in cipso_v4_error()
1845 struct ip_options_rcu *old, *opt = NULL; in cipso_v4_sock_setattr() local
1876 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC); in cipso_v4_sock_setattr()
1877 if (!opt) { in cipso_v4_sock_setattr()
1881 memcpy(opt->opt.__data, buf, buf_len); in cipso_v4_sock_setattr()
1882 opt->opt.optlen = opt_len; in cipso_v4_sock_setattr()
1883 opt->opt.cipso = sizeof(struct iphdr); in cipso_v4_sock_setattr()
1894 sk_conn->icsk_ext_hdr_len -= old->opt.optlen; in cipso_v4_sock_setattr()
1895 sk_conn->icsk_ext_hdr_len += opt->opt.optlen; in cipso_v4_sock_setattr()
1898 rcu_assign_pointer(sk_inet->inet_opt, opt); in cipso_v4_sock_setattr()
1906 kfree(opt); in cipso_v4_sock_setattr()
1930 struct ip_options_rcu *opt = NULL; in cipso_v4_req_setattr() local
1953 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC); in cipso_v4_req_setattr()
1954 if (!opt) { in cipso_v4_req_setattr()
1958 memcpy(opt->opt.__data, buf, buf_len); in cipso_v4_req_setattr()
1959 opt->opt.optlen = opt_len; in cipso_v4_req_setattr()
1960 opt->opt.cipso = sizeof(struct iphdr); in cipso_v4_req_setattr()
1965 opt = xchg((__force struct ip_options_rcu **)&req_inet->ireq_opt, opt); in cipso_v4_req_setattr()
1966 if (opt) in cipso_v4_req_setattr()
1967 kfree_rcu(opt, rcu); in cipso_v4_req_setattr()
1973 kfree(opt); in cipso_v4_req_setattr()
1989 struct ip_options_rcu *opt = rcu_dereference_protected(*opt_ptr, 1); in cipso_v4_delopt() local
1992 if (!opt || opt->opt.cipso == 0) in cipso_v4_delopt()
1994 if (opt->opt.srr || opt->opt.rr || opt->opt.ts || opt->opt.router_alert) { in cipso_v4_delopt()
2001 cipso_off = opt->opt.cipso - sizeof(struct iphdr); in cipso_v4_delopt()
2002 cipso_ptr = &opt->opt.__data[cipso_off]; in cipso_v4_delopt()
2005 if (opt->opt.srr > opt->opt.cipso) in cipso_v4_delopt()
2006 opt->opt.srr -= cipso_len; in cipso_v4_delopt()
2007 if (opt->opt.rr > opt->opt.cipso) in cipso_v4_delopt()
2008 opt->opt.rr -= cipso_len; in cipso_v4_delopt()
2009 if (opt->opt.ts > opt->opt.cipso) in cipso_v4_delopt()
2010 opt->opt.ts -= cipso_len; in cipso_v4_delopt()
2011 if (opt->opt.router_alert > opt->opt.cipso) in cipso_v4_delopt()
2012 opt->opt.router_alert -= cipso_len; in cipso_v4_delopt()
2013 opt->opt.cipso = 0; in cipso_v4_delopt()
2016 opt->opt.optlen - cipso_off - cipso_len); in cipso_v4_delopt()
2025 while (iter < opt->opt.optlen) in cipso_v4_delopt()
2026 if (opt->opt.__data[iter] != IPOPT_NOP) { in cipso_v4_delopt()
2027 iter += opt->opt.__data[iter + 1]; in cipso_v4_delopt()
2031 hdr_delta = opt->opt.optlen; in cipso_v4_delopt()
2032 opt->opt.optlen = (optlen_new + 3) & ~3; in cipso_v4_delopt()
2033 hdr_delta -= opt->opt.optlen; in cipso_v4_delopt()
2038 hdr_delta = opt->opt.optlen; in cipso_v4_delopt()
2039 kfree_rcu(opt, rcu); in cipso_v4_delopt()
2145 struct ip_options_rcu *opt; in cipso_v4_sock_getattr() local
2149 opt = rcu_dereference(inet_sk(sk)->inet_opt); in cipso_v4_sock_getattr()
2150 if (opt && opt->opt.cipso) in cipso_v4_sock_getattr()
2151 res = cipso_v4_getattr(opt->opt.__data + in cipso_v4_sock_getattr()
2152 opt->opt.cipso - in cipso_v4_sock_getattr()
2176 struct ip_options *opt = &IPCB(skb)->opt; in cipso_v4_skbuff_setattr() local
2194 len_delta = opt_len - opt->optlen; in cipso_v4_skbuff_setattr()
2212 memset(iph + 1, IPOPT_NOP, opt->optlen); in cipso_v4_skbuff_setattr()
2216 if (opt->optlen > 0) in cipso_v4_skbuff_setattr()
2217 memset(opt, 0, sizeof(*opt)); in cipso_v4_skbuff_setattr()
2218 opt->optlen = opt_len; in cipso_v4_skbuff_setattr()
2219 opt->cipso = sizeof(struct iphdr); in cipso_v4_skbuff_setattr()
2220 opt->is_changed = 1; in cipso_v4_skbuff_setattr()
2252 struct ip_options *opt = &IPCB(skb)->opt; in cipso_v4_skbuff_delattr() local
2255 if (opt->cipso == 0) in cipso_v4_skbuff_delattr()
2268 cipso_ptr = (unsigned char *)iph + opt->cipso; in cipso_v4_skbuff_delattr()
2270 opt->cipso = 0; in cipso_v4_skbuff_delattr()
2271 opt->is_changed = 1; in cipso_v4_skbuff_delattr()