Lines Matching refs:opt

1551 	unsigned char *opt = *option;  in cipso_v4_validate()  local
1561 opt_len = opt[1]; in cipso_v4_validate()
1568 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2])); in cipso_v4_validate()
1575 tag = opt + opt_iter; in cipso_v4_validate()
1688 *option = opt + err_offset; in cipso_v4_validate()
1722 struct ip_options *opt = (struct ip_options *)optbuf; in cipso_v4_error() local
1733 memset(opt, 0, sizeof(struct ip_options)); in cipso_v4_error()
1734 opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr); in cipso_v4_error()
1736 res = __ip_options_compile(dev_net(skb->dev), opt, skb, NULL); in cipso_v4_error()
1743 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0, opt); in cipso_v4_error()
1745 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0, opt); in cipso_v4_error()
1838 struct ip_options_rcu *old, *opt = NULL; in cipso_v4_sock_setattr() local
1869 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC); in cipso_v4_sock_setattr()
1870 if (!opt) { in cipso_v4_sock_setattr()
1874 memcpy(opt->opt.__data, buf, buf_len); in cipso_v4_sock_setattr()
1875 opt->opt.optlen = opt_len; in cipso_v4_sock_setattr()
1876 opt->opt.cipso = sizeof(struct iphdr); 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()
1891 rcu_assign_pointer(sk_inet->inet_opt, opt); in cipso_v4_sock_setattr()
1899 kfree(opt); in cipso_v4_sock_setattr()
1923 struct ip_options_rcu *opt = NULL; in cipso_v4_req_setattr() local
1946 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC); in cipso_v4_req_setattr()
1947 if (!opt) { in cipso_v4_req_setattr()
1951 memcpy(opt->opt.__data, buf, buf_len); in cipso_v4_req_setattr()
1952 opt->opt.optlen = opt_len; in cipso_v4_req_setattr()
1953 opt->opt.cipso = sizeof(struct iphdr); in cipso_v4_req_setattr()
1958 opt = xchg((__force struct ip_options_rcu **)&req_inet->ireq_opt, opt); in cipso_v4_req_setattr()
1959 if (opt) in cipso_v4_req_setattr()
1960 kfree_rcu(opt, rcu); in cipso_v4_req_setattr()
1966 kfree(opt); in cipso_v4_req_setattr()
1982 struct ip_options_rcu *opt = rcu_dereference_protected(*opt_ptr, 1); in cipso_v4_delopt() local
1985 if (!opt || opt->opt.cipso == 0) in cipso_v4_delopt()
1987 if (opt->opt.srr || opt->opt.rr || opt->opt.ts || opt->opt.router_alert) { in cipso_v4_delopt()
1994 cipso_off = opt->opt.cipso - sizeof(struct iphdr); in cipso_v4_delopt()
1995 cipso_ptr = &opt->opt.__data[cipso_off]; in cipso_v4_delopt()
1998 if (opt->opt.srr > opt->opt.cipso) in cipso_v4_delopt()
1999 opt->opt.srr -= cipso_len; in cipso_v4_delopt()
2000 if (opt->opt.rr > opt->opt.cipso) in cipso_v4_delopt()
2001 opt->opt.rr -= cipso_len; in cipso_v4_delopt()
2002 if (opt->opt.ts > opt->opt.cipso) in cipso_v4_delopt()
2003 opt->opt.ts -= cipso_len; in cipso_v4_delopt()
2004 if (opt->opt.router_alert > opt->opt.cipso) in cipso_v4_delopt()
2005 opt->opt.router_alert -= cipso_len; in cipso_v4_delopt()
2006 opt->opt.cipso = 0; in cipso_v4_delopt()
2009 opt->opt.optlen - cipso_off - cipso_len); in cipso_v4_delopt()
2018 while (iter < opt->opt.optlen) in cipso_v4_delopt()
2019 if (opt->opt.__data[iter] != IPOPT_NOP) { in cipso_v4_delopt()
2020 iter += opt->opt.__data[iter + 1]; in cipso_v4_delopt()
2024 hdr_delta = opt->opt.optlen; in cipso_v4_delopt()
2025 opt->opt.optlen = (optlen_new + 3) & ~3; in cipso_v4_delopt()
2026 hdr_delta -= opt->opt.optlen; in cipso_v4_delopt()
2031 hdr_delta = opt->opt.optlen; in cipso_v4_delopt()
2032 kfree_rcu(opt, rcu); in cipso_v4_delopt()
2138 struct ip_options_rcu *opt; in cipso_v4_sock_getattr() local
2142 opt = rcu_dereference(inet_sk(sk)->inet_opt); in cipso_v4_sock_getattr()
2143 if (opt && opt->opt.cipso) in cipso_v4_sock_getattr()
2144 res = cipso_v4_getattr(opt->opt.__data + in cipso_v4_sock_getattr()
2145 opt->opt.cipso - in cipso_v4_sock_getattr()
2169 struct ip_options *opt = &IPCB(skb)->opt; in cipso_v4_skbuff_setattr() local
2187 len_delta = opt_len - opt->optlen; in cipso_v4_skbuff_setattr()
2205 memset(iph + 1, IPOPT_NOP, opt->optlen); in cipso_v4_skbuff_setattr()
2209 if (opt->optlen > 0) in cipso_v4_skbuff_setattr()
2210 memset(opt, 0, sizeof(*opt)); in cipso_v4_skbuff_setattr()
2211 opt->optlen = opt_len; in cipso_v4_skbuff_setattr()
2212 opt->cipso = sizeof(struct iphdr); in cipso_v4_skbuff_setattr()
2213 opt->is_changed = 1; in cipso_v4_skbuff_setattr()
2245 struct ip_options *opt = &IPCB(skb)->opt; in cipso_v4_skbuff_delattr() local
2248 if (opt->cipso == 0) in cipso_v4_skbuff_delattr()
2261 cipso_ptr = (unsigned char *)iph + opt->cipso; in cipso_v4_skbuff_delattr()
2263 opt->cipso = 0; in cipso_v4_skbuff_delattr()
2264 opt->is_changed = 1; in cipso_v4_skbuff_delattr()