Lines Matching refs:opt

1548 	unsigned char *opt = *option;
1558 opt_len = opt[1];
1565 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2]));
1572 tag = opt + opt_iter;
1685 *option = opt + err_offset;
1719 struct ip_options *opt = (struct ip_options *)optbuf;
1730 memset(opt, 0, sizeof(struct ip_options));
1731 opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr);
1733 res = __ip_options_compile(dev_net(skb->dev), opt, skb, NULL);
1740 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0, opt);
1742 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0, opt);
1837 struct ip_options_rcu *old, *opt = NULL;
1868 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC);
1869 if (!opt) {
1873 memcpy(opt->opt.__data, buf, buf_len);
1874 opt->opt.optlen = opt_len;
1875 opt->opt.cipso = sizeof(struct iphdr);
1885 sk_conn->icsk_ext_hdr_len -= old->opt.optlen;
1886 sk_conn->icsk_ext_hdr_len += opt->opt.optlen;
1889 rcu_assign_pointer(sk_inet->inet_opt, opt);
1897 kfree(opt);
1921 struct ip_options_rcu *opt = NULL;
1944 opt = kzalloc(sizeof(*opt) + opt_len, GFP_ATOMIC);
1945 if (!opt) {
1949 memcpy(opt->opt.__data, buf, buf_len);
1950 opt->opt.optlen = opt_len;
1951 opt->opt.cipso = sizeof(struct iphdr);
1956 opt = xchg((__force struct ip_options_rcu **)&req_inet->ireq_opt, opt);
1957 if (opt)
1958 kfree_rcu(opt, rcu);
1964 kfree(opt);
1980 struct ip_options_rcu *opt = rcu_dereference_protected(*opt_ptr, 1);
1983 if (!opt || opt->opt.cipso == 0)
1985 if (opt->opt.srr || opt->opt.rr || opt->opt.ts || opt->opt.router_alert) {
1992 cipso_off = opt->opt.cipso - sizeof(struct iphdr);
1993 cipso_ptr = &opt->opt.__data[cipso_off];
1996 if (opt->opt.srr > opt->opt.cipso)
1997 opt->opt.srr -= cipso_len;
1998 if (opt->opt.rr > opt->opt.cipso)
1999 opt->opt.rr -= cipso_len;
2000 if (opt->opt.ts > opt->opt.cipso)
2001 opt->opt.ts -= cipso_len;
2002 if (opt->opt.router_alert > opt->opt.cipso)
2003 opt->opt.router_alert -= cipso_len;
2004 opt->opt.cipso = 0;
2007 opt->opt.optlen - cipso_off - cipso_len);
2016 while (iter < opt->opt.optlen)
2017 if (opt->opt.__data[iter] != IPOPT_NOP) {
2018 iter += opt->opt.__data[iter + 1];
2022 hdr_delta = opt->opt.optlen;
2023 opt->opt.optlen = (optlen_new + 3) & ~3;
2024 hdr_delta -= opt->opt.optlen;
2029 hdr_delta = opt->opt.optlen;
2030 kfree_rcu(opt, rcu);
2136 struct ip_options_rcu *opt;
2140 opt = rcu_dereference(inet_sk(sk)->inet_opt);
2141 if (opt && opt->opt.cipso)
2142 res = cipso_v4_getattr(opt->opt.__data +
2143 opt->opt.cipso -
2167 struct ip_options *opt = &IPCB(skb)->opt;
2185 len_delta = opt_len - opt->optlen;
2194 /* we assume that the header + opt->optlen have already been
2203 memset(iph + 1, IPOPT_NOP, opt->optlen);
2207 if (opt->optlen > 0)
2208 memset(opt, 0, sizeof(*opt));
2209 opt->optlen = opt_len;
2210 opt->cipso = sizeof(struct iphdr);
2211 opt->is_changed = 1;
2243 struct ip_options *opt = &IPCB(skb)->opt;
2246 if (opt->cipso == 0)
2259 cipso_ptr = (unsigned char *)iph + opt->cipso;
2261 opt->cipso = 0;
2262 opt->is_changed = 1;