Lines Matching refs:opt

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