/net/ipv4/ |
D | ip_options.c | 44 void ip_options_build(struct sk_buff *skb, struct ip_options *opt, in ip_options_build() argument 49 memcpy(&(IPCB(skb)->opt), opt, sizeof(struct ip_options)); in ip_options_build() 50 memcpy(iph + sizeof(struct iphdr), opt->__data, opt->optlen); in ip_options_build() 51 opt = &(IPCB(skb)->opt); in ip_options_build() 53 if (opt->srr) in ip_options_build() 54 memcpy(iph + opt->srr + iph[opt->srr + 1] - 4, &daddr, 4); in ip_options_build() 56 if (opt->rr_needaddr) in ip_options_build() 57 ip_rt_get_source(iph + opt->rr + iph[opt->rr + 2] - 5, skb, rt); in ip_options_build() 58 if (opt->ts_needaddr) in ip_options_build() 59 ip_rt_get_source(iph + opt->ts + iph[opt->ts + 2] - 9, skb, rt); in ip_options_build() [all …]
|
D | cipso_ipv4.c | 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() [all …]
|
D | ip_output.c | 150 __be32 saddr, __be32 daddr, struct ip_options_rcu *opt, in ip_build_and_send_pkt() argument 159 skb_push(skb, sizeof(struct iphdr) + (opt ? opt->opt.optlen : 0)); in ip_build_and_send_pkt() 166 iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr); in ip_build_and_send_pkt() 184 if (opt && opt->opt.optlen) { in ip_build_and_send_pkt() 185 iph->ihl += opt->opt.optlen>>2; in ip_build_and_send_pkt() 186 ip_options_build(skb, &opt->opt, daddr, rt); in ip_build_and_send_pkt() 484 if (inet_opt && inet_opt->opt.srr) in __ip_queue_xmit() 485 daddr = inet_opt->opt.faddr; in __ip_queue_xmit() 505 if (inet_opt && inet_opt->opt.is_strictroute && rt->rt_uses_gateway) in __ip_queue_xmit() 509 skb_push(skb, sizeof(struct iphdr) + (inet_opt ? inet_opt->opt.optlen : 0)); in __ip_queue_xmit() [all …]
|
D | ip_forward.c | 67 struct ip_options *opt = &(IPCB(skb)->opt); in ip_forward_finish() local 78 if (unlikely(opt->optlen)) in ip_forward_finish() 90 struct ip_options *opt = &(IPCB(skb)->opt); in ip_forward() local 109 if (IPCB(skb)->opt.router_alert && ip_call_ra_chain(skb)) in ip_forward() 130 if (opt->is_strictroute && rt->rt_uses_gateway) in ip_forward() 155 if (IPCB(skb)->flags & IPSKB_DOREDIRECT && !opt->srr && in ip_forward()
|
/net/ceph/ |
D | ceph_common.c | 310 struct ceph_options *opt; in ceph_alloc_options() local 312 opt = kzalloc(sizeof(*opt), GFP_KERNEL); in ceph_alloc_options() 313 if (!opt) in ceph_alloc_options() 316 opt->crush_locs = RB_ROOT; in ceph_alloc_options() 317 opt->mon_addr = kcalloc(CEPH_MAX_MON, sizeof(*opt->mon_addr), in ceph_alloc_options() 319 if (!opt->mon_addr) { in ceph_alloc_options() 320 kfree(opt); in ceph_alloc_options() 324 opt->flags = CEPH_OPT_DEFAULT; in ceph_alloc_options() 325 opt->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT; in ceph_alloc_options() 326 opt->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; in ceph_alloc_options() [all …]
|
/net/ipv6/ |
D | exthdrs.c | 233 struct inet6_skb_parm *opt = IP6CB(skb); in ipv6_dest_hao() local 238 if (opt->dsthao) { in ipv6_dest_hao() 242 opt->dsthao = opt->dst1; in ipv6_dest_hao() 243 opt->dst1 = 0; in ipv6_dest_hao() 297 struct inet6_skb_parm *opt = IP6CB(skb); in ipv6_destopt_rcv() local 319 opt->lastopt = opt->dst1 = skb_network_header_len(skb); in ipv6_destopt_rcv() 321 dstbuf = opt->dst1; in ipv6_destopt_rcv() 326 opt = IP6CB(skb); in ipv6_destopt_rcv() 328 opt->nhoff = dstbuf; in ipv6_destopt_rcv() 330 opt->nhoff = opt->dst1; in ipv6_destopt_rcv() [all …]
|
D | ipv6_sockglue.c | 103 struct ipv6_txoptions *opt) in ipv6_update_options() argument 106 if (opt && in ipv6_update_options() 110 icsk->icsk_ext_hdr_len = opt->opt_flen + opt->opt_nflen; in ipv6_update_options() 114 opt = xchg((__force struct ipv6_txoptions **)&inet6_sk(sk)->opt, in ipv6_update_options() 115 opt); in ipv6_update_options() 118 return opt; in ipv6_update_options() 326 struct ipv6_txoptions *opt; in ipv6_set_opt_hdr() local 353 opt = rcu_dereference_protected(np->opt, lockdep_sock_is_held(sk)); in ipv6_set_opt_hdr() 354 opt = ipv6_renew_options(sk, opt, optname, new); in ipv6_set_opt_hdr() 356 if (IS_ERR(opt)) in ipv6_set_opt_hdr() [all …]
|
D | datagram.c | 76 struct ipv6_txoptions *opt; in ip6_datagram_dst_update() local 91 opt = flowlabel ? flowlabel->opt : rcu_dereference(np->opt); in ip6_datagram_dst_update() 92 final_p = fl6_update_dst(&fl6, opt, &final); in ip6_datagram_dst_update() 625 struct inet6_skb_parm *opt = IP6CB(skb); in ip6_datagram_recv_specific_ctl() local 645 if (np->rxopt.bits.hopopts && (opt->flags & IP6SKB_HOPBYHOP)) { in ip6_datagram_recv_specific_ctl() 650 if (opt->lastopt && in ip6_datagram_recv_specific_ctl() 664 while (off <= opt->lastopt) { in ip6_datagram_recv_specific_ctl() 699 src_info.ipi6_ifindex = opt->iif; in ip6_datagram_recv_specific_ctl() 707 if (np->rxopt.bits.ohopopts && (opt->flags & IP6SKB_HOPBYHOP)) { in ip6_datagram_recv_specific_ctl() 711 if (np->rxopt.bits.odstopts && opt->dst0) { in ip6_datagram_recv_specific_ctl() [all …]
|
D | ip6_output.c | 262 __u32 mark, struct ipv6_txoptions *opt, int tclass, u32 priority) in ip6_xmit() argument 280 if (opt) in ip6_xmit() 281 head_room += opt->opt_nflen + opt->opt_flen; in ip6_xmit() 295 if (opt) { in ip6_xmit() 296 seg_len += opt->opt_nflen + opt->opt_flen; in ip6_xmit() 298 if (opt->opt_flen) in ip6_xmit() 299 ipv6_push_frag_opts(skb, opt, &proto); in ip6_xmit() 301 if (opt->opt_nflen) in ip6_xmit() 302 ipv6_push_nfrag_opts(skb, opt, &proto, &first_hop, in ip6_xmit() 504 struct inet6_skb_parm *opt = IP6CB(skb); in ip6_forward() local [all …]
|
D | ip6_flowlabel.c | 110 kfree(fl->opt); in fl_free_rcu() 120 if (fl_shared_exclusive(fl) || fl->opt) in fl_free() 136 if (fl->opt && fl->share == IPV6_FL_S_EXCL) { in fl_release() 137 struct ipv6_txoptions *opt = fl->opt; in fl_release() local 138 fl->opt = NULL; in fl_release() 139 kfree(opt); in fl_release() 319 struct ipv6_txoptions *fl_opt = fl->opt; in fl6_merge_options() 400 fl->opt = kmalloc(sizeof(*fl->opt) + olen, GFP_KERNEL); in fl_create() 401 if (!fl->opt) in fl_create() 404 memset(fl->opt, 0, sizeof(*fl->opt)); in fl_create() [all …]
|
/net/sched/ |
D | sch_gred.c | 59 struct tc_gred_qopt_offload *opt; member 315 struct tc_gred_qopt_offload *opt = table->opt; in gred_offload() local 320 memset(opt, 0, sizeof(*opt)); in gred_offload() 321 opt->command = command; in gred_offload() 322 opt->handle = sch->handle; in gred_offload() 323 opt->parent = sch->parent; in gred_offload() 328 opt->set.grio_on = gred_rio_mode(table); in gred_offload() 329 opt->set.wred_on = gred_wred_mode(table); in gred_offload() 330 opt->set.dp_cnt = table->DPs; in gred_offload() 331 opt->set.dp_def = table->def; in gred_offload() [all …]
|
D | sch_prio.c | 143 struct tc_prio_qopt_offload opt = { in prio_offload() local 152 opt.command = TC_PRIO_REPLACE; in prio_offload() 153 opt.replace_params.bands = qopt->bands; in prio_offload() 154 memcpy(&opt.replace_params.priomap, qopt->priomap, in prio_offload() 156 opt.replace_params.qstats = &sch->qstats; in prio_offload() 158 opt.command = TC_PRIO_DESTROY; in prio_offload() 161 return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_PRIO, &opt); in prio_offload() 176 static int prio_tune(struct Qdisc *sch, struct nlattr *opt, in prio_tune() argument 184 if (nla_len(opt) < sizeof(*qopt)) in prio_tune() 186 qopt = nla_data(opt); in prio_tune() [all …]
|
D | sch_cbs.c | 277 const struct tc_cbs_qopt *opt, in cbs_enable_offload() argument 292 cbs.hicredit = opt->hicredit; in cbs_enable_offload() 293 cbs.locredit = opt->locredit; in cbs_enable_offload() 294 cbs.idleslope = opt->idleslope; in cbs_enable_offload() 295 cbs.sendslope = opt->sendslope; in cbs_enable_offload() 361 static int cbs_change(struct Qdisc *sch, struct nlattr *opt, in cbs_change() argument 370 err = nla_parse_nested_deprecated(tb, TCA_CBS_MAX, opt, cbs_policy, in cbs_change() 401 static int cbs_init(struct Qdisc *sch, struct nlattr *opt, in cbs_init() argument 407 if (!opt) { in cbs_init() 430 return cbs_change(sch, opt, extack); in cbs_init() [all …]
|
D | sch_red.c | 188 struct tc_red_qopt_offload opt = { in red_offload() local 197 opt.command = TC_RED_REPLACE; in red_offload() 198 opt.set.min = q->parms.qth_min >> q->parms.Wlog; in red_offload() 199 opt.set.max = q->parms.qth_max >> q->parms.Wlog; in red_offload() 200 opt.set.probability = q->parms.max_P; in red_offload() 201 opt.set.limit = q->limit; in red_offload() 202 opt.set.is_ecn = red_use_ecn(q); in red_offload() 203 opt.set.is_harddrop = red_use_harddrop(q); in red_offload() 204 opt.set.is_nodrop = red_use_nodrop(q); in red_offload() 205 opt.set.qstats = &sch->qstats; in red_offload() [all …]
|
D | sch_sfq.c | 626 static int sfq_change(struct Qdisc *sch, struct nlattr *opt) in sfq_change() argument 629 struct tc_sfq_qopt *ctl = nla_data(opt); in sfq_change() 636 if (opt->nla_len < nla_attr_size(sizeof(*ctl))) in sfq_change() 638 if (opt->nla_len >= nla_attr_size(sizeof(*ctl_v1))) in sfq_change() 639 ctl_v1 = nla_data(opt); in sfq_change() 734 static int sfq_init(struct Qdisc *sch, struct nlattr *opt, in sfq_init() argument 764 if (opt) { in sfq_init() 765 int err = sfq_change(sch, opt); in sfq_init() 795 struct tc_sfq_qopt_v1 opt; in sfq_dump() local 798 memset(&opt, 0, sizeof(opt)); in sfq_dump() [all …]
|
D | sch_fifo.c | 96 static int __fifo_init(struct Qdisc *sch, struct nlattr *opt, in __fifo_init() argument 102 if (opt == NULL) { in __fifo_init() 110 struct tc_fifo_qopt *ctl = nla_data(opt); in __fifo_init() 112 if (nla_len(opt) < sizeof(*ctl)) in __fifo_init() 131 static int fifo_init(struct Qdisc *sch, struct nlattr *opt, in fifo_init() argument 136 err = __fifo_init(sch, opt, extack); in fifo_init() 144 static int fifo_hd_init(struct Qdisc *sch, struct nlattr *opt, in fifo_hd_init() argument 147 return __fifo_init(sch, opt, extack); in fifo_hd_init() 157 struct tc_fifo_qopt opt = { .limit = sch->limit }; in __fifo_dump() local 159 if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt)) in __fifo_dump()
|
D | em_ipset.c | 53 struct ip_set_adt_opt opt; in em_ipset_match() local 80 opt.family = state.pf; in em_ipset_match() 81 opt.dim = set->dim; in em_ipset_match() 82 opt.flags = set->flags; in em_ipset_match() 83 opt.cmdflags = 0; in em_ipset_match() 84 opt.ext.timeout = ~0u; in em_ipset_match() 100 ret = ip_set_test(set->index, skb, &acpar, &opt); in em_ipset_match()
|
/net/netfilter/ |
D | xt_TCPMSS.c | 34 optlen(const u_int8_t *opt, unsigned int offset) in optlen() argument 37 if (opt[offset] <= TCPOPT_NOP || opt[offset+1] == 0) in optlen() 40 return opt[offset+1]; in optlen() 83 u8 *opt; in tcpmss_mangle_packet() local 116 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet() 117 for (i = sizeof(struct tcphdr); i <= tcp_hdrlen - TCPOLEN_MSS; i += optlen(opt, i)) { in tcpmss_mangle_packet() 118 if (opt[i] == TCPOPT_MSS && opt[i+1] == TCPOLEN_MSS) { in tcpmss_mangle_packet() 121 oldmss = (opt[i+2] << 8) | opt[i+3]; in tcpmss_mangle_packet() 130 opt[i+2] = (newmss & 0xff00) >> 8; in tcpmss_mangle_packet() 131 opt[i+3] = newmss & 0x00ff; in tcpmss_mangle_packet() [all …]
|
D | nft_exthdr.c | 29 static unsigned int optlen(const u8 *opt, unsigned int offset) in optlen() argument 32 if (opt[offset] <= TCPOPT_NOP || opt[offset + 1] == 0) in optlen() 35 return opt[offset + 1]; in optlen() 86 struct ip_options *opt = (struct ip_options *)optbuf; in ipv4_find_option() local 102 memset(opt, 0, sizeof(struct ip_options)); in ipv4_find_option() 106 if (skb_copy_bits(skb, start, opt->__data, optlen)) in ipv4_find_option() 108 opt->optlen = optlen; in ipv4_find_option() 110 if (__ip_options_compile(net, opt, NULL, &info)) in ipv4_find_option() 116 if (!opt->srr) in ipv4_find_option() 118 found = target == IPOPT_SSRR ? opt->is_strictroute : in ipv4_find_option() [all …]
|
D | xt_TCPOPTSTRIP.c | 19 static inline unsigned int optlen(const u_int8_t *opt, unsigned int offset) in optlen() argument 22 if (opt[offset] <= TCPOPT_NOP || opt[offset+1] == 0) in optlen() 25 return opt[offset+1]; in optlen() 37 u_int8_t *opt; in tcpoptstrip_mangle_packet() local 57 opt = (u8 *)tcph; in tcpoptstrip_mangle_packet() 64 optl = optlen(opt, i); in tcpoptstrip_mangle_packet() 69 if (!tcpoptstrip_test_bit(info->strip_bmap, opt[i])) in tcpoptstrip_mangle_packet() 73 o = opt[i+j]; in tcpoptstrip_mangle_packet() 82 memset(opt + i, TCPOPT_NOP, optl); in tcpoptstrip_mangle_packet()
|
/net/dns_resolver/ |
D | dns_key.c | 98 const char *data = prep->data, *end, *opt; in dns_resolver_preparse() local 144 opt = memchr(data, '#', datalen); in dns_resolver_preparse() 145 if (!opt) { in dns_resolver_preparse() 152 result_len = opt - data; in dns_resolver_preparse() 153 opt++; in dns_resolver_preparse() 154 kdebug("options: '%s'", opt); in dns_resolver_preparse() 160 next_opt = memchr(opt, '#', end - opt) ?: end; in dns_resolver_preparse() 161 opt_len = next_opt - opt; in dns_resolver_preparse() 168 eq = memchr(opt, '=', opt_len); in dns_resolver_preparse() 170 opt_nlen = eq - opt; in dns_resolver_preparse() [all …]
|
/net/nfc/nci/ |
D | core.c | 99 void (*req)(struct nci_dev *ndev, const void *opt), in __nci_request() argument 100 const void *opt, __u32 timeout) in __nci_request() 108 req(ndev, opt); in __nci_request() 143 const void *opt), in nci_request() argument 144 const void *opt, __u32 timeout) in nci_request() 154 rc = __nci_request(ndev, req, opt, timeout); in nci_request() 162 static void nci_reset_req(struct nci_dev *ndev, const void *opt) in nci_reset_req() argument 170 static void nci_init_req(struct nci_dev *ndev, const void *opt) in nci_init_req() argument 174 if (opt) in nci_init_req() 177 nci_send_cmd(ndev, NCI_OP_CORE_INIT_CMD, plen, opt); in nci_init_req() [all …]
|
/net/can/ |
D | isotp.c | 158 struct can_isotp_options opt; member 182 return so->opt.flags & ISOTP_ALL_BC_FLAGS; in isotp_bc_flags() 242 if (so->opt.flags & CAN_ISOTP_TX_PADDING) { in isotp_send_fc() 243 memset(ncf->data, so->opt.txpad_content, CAN_MAX_DLEN); in isotp_send_fc() 254 ncf->data[0] = so->opt.ext_address; in isotp_send_fc() 337 if (!(so->opt.flags & CAN_ISOTP_RX_PADDING)) { in check_pad() 338 if (so->opt.flags & CAN_ISOTP_CHK_PAD_LEN) in check_pad() 346 if ((so->opt.flags & CAN_ISOTP_CHK_PAD_LEN) && in check_pad() 351 if (so->opt.flags & CAN_ISOTP_CHK_PAD_DATA) { in check_pad() 372 ((so->opt.flags & ISOTP_CHECK_PADDING) && in isotp_rcv_fc() [all …]
|
/net/dccp/ |
D | ipv6.c | 74 static int dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, in dccp_v6_err() argument 218 final_p = fl6_update_dst(&fl6, rcu_dereference(np->opt), &final); in dccp_v6_send_response() 231 struct ipv6_txoptions *opt; in dccp_v6_send_response() local 238 opt = ireq->ipv6_opt; in dccp_v6_send_response() 239 if (!opt) in dccp_v6_send_response() 240 opt = rcu_dereference(np->opt); in dccp_v6_send_response() 241 err = ip6_xmit(sk, skb, &fl6, READ_ONCE(sk->sk_mark), opt, in dccp_v6_send_response() 425 struct ipv6_txoptions *opt; in dccp_v6_request_recv_sock() local 451 newnp->opt = NULL; in dccp_v6_request_recv_sock() 523 newnp->opt = NULL; in dccp_v6_request_recv_sock() [all …]
|
/net/netfilter/ipset/ |
D | ip_set_hash_ipmac.c | 86 enum ipset_adt adt, struct ip_set_adt_opt *opt) in hash_ipmac4_kadt() argument 90 struct ip_set_ext ext = IP_SET_INIT_KEXT(skb, opt, set); in hash_ipmac4_kadt() 96 if (opt->flags & IPSET_DIM_TWO_SRC) in hash_ipmac4_kadt() 104 ip4addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip); in hash_ipmac4_kadt() 106 return adtfn(set, &e, &ext, &opt->ext, opt->cmdflags); in hash_ipmac4_kadt() 199 enum ipset_adt adt, struct ip_set_adt_opt *opt) in hash_ipmac6_kadt() argument 206 struct ip_set_ext ext = IP_SET_INIT_KEXT(skb, opt, set); in hash_ipmac6_kadt() 212 if (opt->flags & IPSET_DIM_TWO_SRC) in hash_ipmac6_kadt() 220 ip6addrptr(skb, opt->flags & IPSET_DIM_ONE_SRC, &e.ip.in6); in hash_ipmac6_kadt() 222 return adtfn(set, &e, &ext, &opt->ext, opt->cmdflags); in hash_ipmac6_kadt()
|