Lines Matching refs:opt

1552 	unsigned char *opt = *option;
1562 opt_len = opt[1];
1569 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2]));
1576 tag = opt + opt_iter;
1689 *option = opt + err_offset;
1723 struct ip_options *opt = (struct ip_options *)optbuf;
1734 memset(opt, 0, sizeof(struct ip_options));
1735 opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr);
1737 res = __ip_options_compile(dev_net(skb->dev), opt, skb, NULL);
1744 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0, opt);
1746 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0, opt);
1839 struct ip_options_rcu *old, *opt = NULL;
1870 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC);
1871 if (!opt) {
1875 memcpy(opt->opt.__data, buf, buf_len);
1876 opt->opt.optlen = opt_len;
1877 opt->opt.cipso = sizeof(struct iphdr);
1888 sk_conn->icsk_ext_hdr_len -= old->opt.optlen;
1889 sk_conn->icsk_ext_hdr_len += opt->opt.optlen;
1892 rcu_assign_pointer(sk_inet->inet_opt, opt);
1900 kfree(opt);
1924 struct ip_options_rcu *opt = NULL;
1947 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC);
1948 if (!opt) {
1952 memcpy(opt->opt.__data, buf, buf_len);
1953 opt->opt.optlen = opt_len;
1954 opt->opt.cipso = sizeof(struct iphdr);
1959 opt = xchg((__force struct ip_options_rcu **)&req_inet->ireq_opt, opt);
1960 if (opt)
1961 kfree_rcu(opt, rcu);
1967 kfree(opt);
1983 struct ip_options_rcu *opt = rcu_dereference_protected(*opt_ptr, 1);
1986 if (!opt || opt->opt.cipso == 0)
1988 if (opt->opt.srr || opt->opt.rr || opt->opt.ts || opt->opt.router_alert) {
1995 cipso_off = opt->opt.cipso - sizeof(struct iphdr);
1996 cipso_ptr = &opt->opt.__data[cipso_off];
1999 if (opt->opt.srr > opt->opt.cipso)
2000 opt->opt.srr -= cipso_len;
2001 if (opt->opt.rr > opt->opt.cipso)
2002 opt->opt.rr -= cipso_len;
2003 if (opt->opt.ts > opt->opt.cipso)
2004 opt->opt.ts -= cipso_len;
2005 if (opt->opt.router_alert > opt->opt.cipso)
2006 opt->opt.router_alert -= cipso_len;
2007 opt->opt.cipso = 0;
2010 opt->opt.optlen - cipso_off - cipso_len);
2019 while (iter < opt->opt.optlen)
2020 if (opt->opt.__data[iter] != IPOPT_NOP) {
2021 iter += opt->opt.__data[iter + 1];
2025 hdr_delta = opt->opt.optlen;
2026 opt->opt.optlen = (optlen_new + 3) & ~3;
2027 hdr_delta -= opt->opt.optlen;
2032 hdr_delta = opt->opt.optlen;
2033 kfree_rcu(opt, rcu);
2139 struct ip_options_rcu *opt;
2143 opt = rcu_dereference(inet_sk(sk)->inet_opt);
2144 if (opt && opt->opt.cipso)
2145 res = cipso_v4_getattr(opt->opt.__data +
2146 opt->opt.cipso -
2170 struct ip_options *opt = &IPCB(skb)->opt;
2188 len_delta = opt_len - opt->optlen;
2197 /* we assume that the header + opt->optlen have already been
2206 memset(iph + 1, IPOPT_NOP, opt->optlen);
2210 if (opt->optlen > 0)
2211 memset(opt, 0, sizeof(*opt));
2212 opt->optlen = opt_len;
2213 opt->cipso = sizeof(struct iphdr);
2214 opt->is_changed = 1;
2246 struct ip_options *opt = &IPCB(skb)->opt;
2249 if (opt->cipso == 0)
2262 cipso_ptr = (unsigned char *)iph + opt->cipso;
2264 opt->cipso = 0;
2265 opt->is_changed = 1;