/net/ipv4/ |
D | fib_semantics.c | 68 int nhsel; const struct fib_nh *nh; \ 69 for (nhsel = 0, nh = (fi)->fib_nh; \ 71 nh++, nhsel++) 84 int nhsel; const struct fib_nh *nh = (fi)->fib_nh; \ 235 if (fi->nh) { in free_fib_info_rcu() 236 nexthop_put(fi->nh); in free_fib_info_rcu() 270 if (fi->nh) { in fib_release_info() 290 if (fi->nh || ofi->nh) in nh_comp() 291 return nexthop_cmp(fi->nh, ofi->nh) ? 0 : -1; in nh_comp() 299 if (nh->fib_nh_oif != onh->fib_nh_oif || in nh_comp() [all …]
|
D | nexthop.c | 22 static void remove_nexthop(struct net *net, struct nexthop *nh, 100 const struct nexthop *nh) in nh_notifier_single_info_init() argument 102 struct nh_info *nhi = rtnl_dereference(nh->nh_info); in nh_notifier_single_info_init() 105 info->nh = kzalloc(sizeof(*info->nh), GFP_KERNEL); in nh_notifier_single_info_init() 106 if (!info->nh) in nh_notifier_single_info_init() 109 __nh_notifier_single_info_init(info->nh, nhi); in nh_notifier_single_info_init() 116 kfree(info->nh); in nh_notifier_single_info_fini() 138 nhi = rtnl_dereference(nhge->nh->nh_info); in nh_notifier_mpath_info_init() 139 info->nh_grp->nh_entries[i].id = nhge->nh->id; in nh_notifier_mpath_info_init() 141 __nh_notifier_single_info_init(&info->nh_grp->nh_entries[i].nh, in nh_notifier_mpath_info_init() [all …]
|
D | icmp.c | 1191 int nh; in icmp_rcv() local 1200 nh = skb_network_offset(skb); in icmp_rcv() 1206 skb_set_network_header(skb, nh); in icmp_rcv()
|
/net/openvswitch/ |
D | actions.c | 313 const struct nshhdr *nh) in push_nsh() argument 317 err = nsh_push(skb, nh); in push_nsh() 344 static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh, in update_ip_l4_checksum() argument 349 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum() 352 if (nh->protocol == IPPROTO_TCP) { in update_ip_l4_checksum() 356 } else if (nh->protocol == IPPROTO_UDP) { in update_ip_l4_checksum() 370 static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, in set_ip_addr() argument 373 update_ip_l4_checksum(skb, nh, *addr, new_addr); in set_ip_addr() 374 csum_replace4(&nh->check, *addr, new_addr); in set_ip_addr() 428 static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, u8 ipv6_tclass, u8 mask) in set_ipv6_dsfield() argument [all …]
|
D | flow.c | 249 struct ipv6hdr *nh; in parse_ipv6hdr() local 252 err = check_header(skb, nh_ofs + sizeof(*nh)); in parse_ipv6hdr() 256 nh = ipv6_hdr(skb); in parse_ipv6hdr() 259 key->ip.tos = ipv6_get_dsfield(nh); in parse_ipv6hdr() 260 key->ip.ttl = nh->hop_limit; in parse_ipv6hdr() 261 key->ipv6.label = *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in parse_ipv6hdr() 262 key->ipv6.addr.src = nh->saddr; in parse_ipv6hdr() 263 key->ipv6.addr.dst = nh->daddr; in parse_ipv6hdr() 486 struct nshhdr *nh; in parse_nsh() local 495 nh = nsh_hdr(skb); in parse_nsh() [all …]
|
D | flow_netlink.h | 70 int nsh_hdr_from_nlattr(const struct nlattr *attr, struct nshhdr *nh,
|
D | flow_netlink.c | 1284 struct nshhdr *nh, size_t size) in nsh_hdr_from_nlattr() argument 1306 nh->np = base->np; in nsh_hdr_from_nlattr() 1307 nh->mdtype = base->mdtype; in nsh_hdr_from_nlattr() 1308 nh->path_hdr = base->path_hdr; in nsh_hdr_from_nlattr() 1315 memcpy(&nh->md1, nla_data(a), mdlen); in nsh_hdr_from_nlattr() 1322 memcpy(&nh->md2, nla_data(a), mdlen); in nsh_hdr_from_nlattr() 1331 nh->ver_flags_ttl_len = 0; in nsh_hdr_from_nlattr() 1332 nsh_set_flags_ttl_len(nh, flags, ttl, NSH_BASE_HDR_LEN + mdlen); in nsh_hdr_from_nlattr()
|
/net/mpls/ |
D | af_mpls.c | 95 static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh) in __mpls_nh_via() argument 97 return (u8 *)nh + rt->rt_via_offset; in __mpls_nh_via() 101 const struct mpls_nh *nh) in mpls_nh_via() argument 103 return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh); in mpls_nh_via() 106 static unsigned int mpls_nh_header_size(const struct mpls_nh *nh) in mpls_nh_header_size() argument 109 return nh->nh_labels * sizeof(struct mpls_shim_hdr); in mpls_nh_header_size() 256 unsigned int nh_flags = READ_ONCE(nh->nh_flags); in mpls_select_multipath() 261 return nh; in mpls_select_multipath() 347 struct mpls_nh *nh; in mpls_forward() local 392 nh = mpls_select_multipath(rt, skb); in mpls_forward() [all …]
|
D | internal.h | 161 int nhsel; struct mpls_nh *nh; u8 *__nh; \ 162 for (nhsel = 0, nh = (rt)->rt_nh, __nh = (u8 *)((rt)->rt_nh); \ 164 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++) 167 int nhsel; struct mpls_nh *nh; u8 *__nh; \ 168 for (nhsel = 0, nh = (struct mpls_nh *)((rt)->rt_nh), \ 171 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
|
/net/ipv6/ |
D | route.c | 106 static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif, 420 if (!match->nh && (!match->fib6_nsiblings || have_oif_match)) in fib6_select_path() 423 if (match->nh && have_oif_match && res->nh) in fib6_select_path() 430 (!match->nh || nexthop_is_multipath(match->nh))) in fib6_select_path() 433 if (unlikely(match->nh)) { in fib6_select_path() 443 const struct fib6_nh *nh = sibling->fib6_nh; in fib6_select_path() local 446 nh_upper_bound = atomic_read(&nh->fib_nh_upper_bound); in fib6_select_path() 449 if (rt6_score_route(nh, sibling->fib6_flags, oif, strict) < 0) in fib6_select_path() 457 res->nh = match->fib6_nh; in fib6_select_path() 464 static bool __rt6_device_match(struct net *net, const struct fib6_nh *nh, in __rt6_device_match() argument [all …]
|
D | exthdrs.c | 117 const unsigned char *nh = skb_network_header(skb); in ip6_parse_tlv() local 137 if (nh[off] == IPV6_TLV_PAD1) { in ip6_parse_tlv() 147 optlen = nh[off + 1] + 2; in ip6_parse_tlv() 151 if (nh[off] == IPV6_TLV_PADN) { in ip6_parse_tlv() 165 if (nh[off + i] != 0) in ip6_parse_tlv() 174 switch (nh[off]) { in ip6_parse_tlv() 198 switch (nh[off]) { in ip6_parse_tlv() 922 const unsigned char *nh = skb_network_header(skb); in ipv6_hop_ra() local 924 if (nh[optoff + 1] == 2) { in ipv6_hop_ra() 926 memcpy(&IP6CB(skb)->ra, nh + optoff + 2, sizeof(IP6CB(skb)->ra)); in ipv6_hop_ra() [all …]
|
D | exthdrs_core.c | 118 const unsigned char *nh = skb_network_header(skb); in ipv6_find_tlv() local 125 hdr = (struct ipv6_opt_hdr *)(nh + offset); in ipv6_find_tlv() 135 int opttype = nh[offset]; in ipv6_find_tlv() 148 optlen = nh[offset + 1] + 2; in ipv6_find_tlv()
|
D | datagram.c | 481 const unsigned char *nh = skb_network_header(skb); in ipv6_recv_error() local 486 const struct ipv6hdr *ip6h = container_of((struct in6_addr *)(nh + serr->addr_offset), in ipv6_recv_error() 495 ipv6_addr_set_v4mapped(*(__be32 *)(nh + serr->addr_offset), in ipv6_recv_error() 619 unsigned char *nh = skb_network_header(skb); in ip6_datagram_recv_specific_ctl() local 632 __be32 flowinfo = ip6_flowinfo((struct ipv6hdr *)nh); in ip6_datagram_recv_specific_ctl() 639 u8 *ptr = nh + sizeof(struct ipv6hdr); in ip6_datagram_recv_specific_ctl() 659 u8 *ptr = nh + off; in ip6_datagram_recv_specific_ctl() 701 u8 *ptr = nh + sizeof(struct ipv6hdr); in ip6_datagram_recv_specific_ctl() 705 u8 *ptr = nh + opt->dst0; in ip6_datagram_recv_specific_ctl() 709 struct ipv6_rt_hdr *rthdr = (struct ipv6_rt_hdr *)(nh + opt->srcrt); in ip6_datagram_recv_specific_ctl() [all …]
|
D | ip6_fib.c | 172 if (f6i->nh) in fib6_info_destroy_rcu() 173 nexthop_put(f6i->nh); in fib6_info_destroy_rcu() 993 static int fib6_nh_drop_pcpu_from(struct fib6_nh *nh, void *_arg) in fib6_nh_drop_pcpu_from() argument 997 __fib6_drop_pcpu_from(nh, arg->from, arg->table); in fib6_nh_drop_pcpu_from() 1010 if (f6i->nh) { in fib6_drop_pcpu_from() 1016 nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_drop_pcpu_from, in fib6_drop_pcpu_from() 1035 if (rt->nh && !list_empty(&rt->nh_list)) in fib6_purge_rt() 1479 if (rt->nh) in fib6_add() 1480 list_add(&rt->nh_list, &rt->nh->f6i_list); in fib6_add() 2489 if (rt->nh) in ipv6_route_native_seq_show() [all …]
|
D | reassembly.c | 136 const unsigned char *nh = skb_network_header(skb); in ip6_frag_queue() local 138 csum_partial(nh, (u8 *)(fhdr + 1) - nh, in ip6_frag_queue()
|
D | icmp.c | 888 int nh; in icmpv6_rcv() local 897 nh = skb_network_offset(skb); in icmpv6_rcv() 903 skb_set_network_header(skb, nh); in icmpv6_rcv()
|
/net/nsh/ |
D | nsh.c | 16 struct nshhdr *nh; in nsh_push() local 33 nh = (struct nshhdr *)(skb->data); in nsh_push() 34 memcpy(nh, pushed_nh, length); in nsh_push() 35 nh->np = next_proto; in nsh_push() 36 skb_postpush_rcsum(skb, nh, length); in nsh_push() 49 struct nshhdr *nh; in nsh_pop() local 55 nh = (struct nshhdr *)(skb->data); in nsh_pop() 56 length = nsh_hdr_len(nh); in nsh_pop() 59 inner_proto = tun_p_to_eth_p(nh->np); in nsh_pop()
|
/net/bridge/ |
D | br_netfilter_ipv6.c | 50 const unsigned char *nh = skb_network_header(skb); in br_nf_check_hbh_len() local 51 int off = raw - nh; in br_nf_check_hbh_len() 61 int optlen = nh[off + 1] + 2; in br_nf_check_hbh_len() 63 switch (nh[off]) { in br_nf_check_hbh_len() 72 if (nh[off + 1] != 4 || (off & 3) != 2) in br_nf_check_hbh_len() 74 pkt_len = ntohl(*(__be32 *)(nh + off + 2)); in br_nf_check_hbh_len() 83 nh = skb_network_header(skb); in br_nf_check_hbh_len()
|
/net/netfilter/ |
D | nf_nat_masquerade.c | 36 __be32 newsrc, nh; in nf_nat_masquerade_ipv4() local 52 nh = rt_nexthop(rt, ip_hdr(skb)->daddr); in nf_nat_masquerade_ipv4() 53 newsrc = inet_select_addr(out, nh, RT_SCOPE_UNIVERSE); in nf_nat_masquerade_ipv4()
|
/net/xfrm/ |
D | xfrm_policy.c | 3376 const unsigned char *nh = skb_network_header(skb); in decode_session6() local 3384 nexthdr = nh[nhoff]; in decode_session6() 3396 while (nh + offset + sizeof(*exthdr) < skb->data || in decode_session6() 3397 pskb_may_pull(skb, nh + offset + sizeof(*exthdr) - skb->data)) { in decode_session6() 3398 nh = skb_network_header(skb); in decode_session6() 3399 exthdr = (struct ipv6_opt_hdr *)(nh + offset); in decode_session6() 3410 exthdr = (struct ipv6_opt_hdr *)(nh + offset); in decode_session6() 3417 if (!onlyproto && (nh + offset + 4 < skb->data || in decode_session6() 3418 pskb_may_pull(skb, nh + offset + 4 - skb->data))) { in decode_session6() 3421 nh = skb_network_header(skb); in decode_session6() [all …]
|
D | xfrm_output.c | 83 const unsigned char *nh = skb_network_header(skb); in mip6_rthdr_offset() local 88 packet_len = skb_tail_pointer(skb) - nh; in mip6_rthdr_offset() 101 rt = (struct ipv6_rt_hdr *)(nh + offset); in mip6_rthdr_offset()
|
/net/ipv6/netfilter/ |
D | nf_conntrack_reasm.c | 194 const unsigned char *nh = skb_network_header(skb); in nf_ct_frag6_queue() local 196 csum_partial(nh, (u8 *)(fhdr + 1) - nh, in nf_ct_frag6_queue()
|
/net/core/ |
D | filter.c | 2177 struct net_device *dev, struct bpf_nh_params *nh) in bpf_out_neigh_v6() argument 2199 if (!nh) { in bpf_out_neigh_v6() 2204 nexthop = &nh->ipv6_nh; in bpf_out_neigh_v6() 2226 struct bpf_nh_params *nh) in __bpf_redirect_neigh_v6() argument 2232 if (!nh) { in __bpf_redirect_neigh_v6() 2249 } else if (nh->nh_family != AF_INET6) { in __bpf_redirect_neigh_v6() 2253 err = bpf_out_neigh_v6(net, skb, dev, nh); in __bpf_redirect_neigh_v6() 2267 struct bpf_nh_params *nh) in __bpf_redirect_neigh_v6() argument 2276 struct net_device *dev, struct bpf_nh_params *nh) in bpf_out_neigh_v4() argument 2297 if (!nh) { in bpf_out_neigh_v4() [all …]
|
/net/dsa/ |
D | dsa2.c | 39 struct raw_notifier_head *nh = &dst->nh; in dsa_tree_notify() local 42 err = raw_notifier_call_chain(nh, e, v); in dsa_tree_notify()
|
D | switch.c | 772 return raw_notifier_chain_register(&ds->dst->nh, &ds->nb); in dsa_switch_register_notifier() 779 err = raw_notifier_chain_unregister(&ds->dst->nh, &ds->nb); in dsa_switch_unregister_notifier()
|