/linux-6.3-rc2/net/ipv6/netfilter/ |
A D | ip6t_srh.c | 27 struct ipv6_sr_hdr *srh; in srh_mt6() local 34 if (!srh) in srh_mt6() 37 hdrlen = ipv6_optlen(srh); in srh_mt6() 44 if (srh->segments_left > srh->first_segment) in srh_mt6() 111 !(srh->tag == srhinfo->tag))) in srh_mt6() 122 struct ipv6_sr_hdr *srh; in srh1_mt6() local 128 if (!srh) in srh1_mt6() 131 hdrlen = ipv6_optlen(srh); in srh1_mt6() 138 if (srh->segments_left > srh->first_segment) in srh1_mt6() 204 if (srh->segments_left == srh->first_segment) in srh1_mt6() [all …]
|
A D | Kconfig | 168 tristate '"srh" Segment Routing header match support' 171 srh matching allows you to match packets based on the segment
|
/linux-6.3-rc2/tools/testing/selftests/bpf/progs/ |
A D | test_lwt_seg6local.c | 77 srh = cursor_advance(cursor, sizeof(*srh)); in get_srh() 78 if ((void *)srh + sizeof(*srh) > data_end) in get_srh() 84 return srh; in get_srh() 296 srh->hdrlen = 8; in __encap_srh() 297 srh->type = 4; in __encap_srh() 300 srh->flags = 0; in __encap_srh() 301 srh->tag = 0; in __encap_srh() 303 seg = (struct ip6_addr_t *)((char *)srh + sizeof(*srh)); in __encap_srh() 331 if (srh == NULL) in __add_egr_x() 337 err = add_tlv(skb, srh, (srh->hdrlen+1) << 3, in __add_egr_x() [all …]
|
A D | test_seg6_loop.c | 56 struct ip6_srh_t *srh; in get_srh() local 77 srh = cursor_advance(cursor, sizeof(*srh)); in get_srh() 78 if ((void *)srh + sizeof(*srh) > data_end) in get_srh() 81 if (srh->type != 4) in get_srh() 84 return srh; in get_srh() 118 struct ip6_srh_t *srh, in is_valid_tlv_boundary() argument 129 cur_off = srh_off + sizeof(*srh) + in is_valid_tlv_boundary() 180 struct ip6_srh_t *srh, uint32_t tlv_off, in add_tlv() argument 230 struct ip6_srh_t *srh = get_srh(skb); in __add_egr_x() local 235 if (srh == NULL) in __add_egr_x() [all …]
|
/linux-6.3-rc2/net/ipv6/ |
A D | rpl_iptunnel.c | 44 if ((srh->hdrlen << 3) != seglen) in rpl_validate_srh() 48 if (!srh->segments_left || in rpl_validate_srh() 52 if (srh->cmpri || srh->cmpre) in rpl_validate_srh() 56 srh->segments_left); in rpl_validate_srh() 60 if (ipv6_addr_type(&srh->rpl_segaddr[srh->segments_left - 1]) & in rpl_validate_srh() 74 struct ipv6_rpl_sr_hdr *srh; in rpl_build_state() local 92 if (srh_len < sizeof(*srh)) in rpl_build_state() 96 if (!rpl_validate_srh(net, srh, srh_len - sizeof(*srh))) in rpl_build_state() 111 memcpy(&rlwt->tuninfo.srh, srh, srh_len); in rpl_build_state() 139 buf = kcalloc(struct_size(srh, segments.addr, srh->segments_left), 2, GFP_ATOMIC); in rpl_do_srh_inline() [all …]
|
A D | seg6.c | 34 if (srh->type != IPV6_SRCRT_TYPE_4) in seg6_validate_srh() 37 if (((srh->hdrlen + 1) << 3) != len) in seg6_validate_srh() 40 if (!reduced && srh->segments_left > srh->first_segment) { in seg6_validate_srh() 48 if (srh->segments_left > srh->first_segment + 1) in seg6_validate_srh() 52 tlv_offset = sizeof(*srh) + ((srh->first_segment + 1) << 4); in seg6_validate_srh() 80 struct ipv6_sr_hdr *srh; in seg6_get_srh() local 91 len = (srh->hdrlen + 1) << 3; in seg6_get_srh() 104 return srh; in seg6_get_srh() 114 struct ipv6_sr_hdr *srh; in seg6_icmp_srh() local 122 srh = seg6_get_srh(skb, 0); in seg6_icmp_srh() [all …]
|
A D | seg6_local.c | 217 if (!srh) in get_and_validate_srh() 234 if (srh && srh->segments_left > 0) in decap_and_validate() 263 addr = srh->segments + srh->segments_left; in advance_nextseg() 388 if (!srh) in input_action_end_core() 439 if (!srh) in seg6_get_srh_pktinfo() 752 if (!srh) in input_action_end_x() 1329 struct ipv6_sr_hdr *srh = srh_state->srh; in seg6_bpf_has_valid_srh() local 1367 srh_state->srh = srh; in input_action_end_bpf() 1607 slwt->srh = kmemdup(srh, len, GFP_KERNEL); in parse_nla_srh() 1622 srh = slwt->srh; in put_nla_srh() [all …]
|
A D | seg6_hmac.c | 84 static struct sr6_tlv_hmac *seg6_get_tlv_hmac(struct ipv6_sr_hdr *srh) in seg6_get_tlv_hmac() argument 88 if (srh->hdrlen < (srh->first_segment + 1) * 2 + 5) in seg6_get_tlv_hmac() 91 if (!sr_has_hmac(srh)) in seg6_get_tlv_hmac() 95 ((char *)srh + ((srh->hdrlen + 1) << 3) - 40); in seg6_get_tlv_hmac() 242 struct ipv6_sr_hdr *srh; in seg6_hmac_validate_skb() local 247 srh = (struct ipv6_sr_hdr *)skb_transport_header(skb); in seg6_hmac_validate_skb() 249 tlv = seg6_get_tlv_hmac(srh); in seg6_hmac_validate_skb() 269 if (seg6_hmac_compute(hinfo, srh, &ipv6_hdr(skb)->saddr, hmac_output)) in seg6_hmac_validate_skb() 326 struct ipv6_sr_hdr *srh) in seg6_push_hmac() argument 332 tlv = seg6_get_tlv_hmac(srh); in seg6_push_hmac() [all …]
|
A D | seg6_iptunnel.c | 47 return ((tuninfo->srh->hdrlen + 1) << 3) + head; in seg6_lwt_headroom() 387 err = seg6_do_srh_inline(skb, tinfo->srh); in seg6_do_srh() 405 err = seg6_do_srh_encap(skb, tinfo->srh, proto); in seg6_do_srh() 407 err = seg6_do_srh_encap_red(skb, tinfo->srh, proto); in seg6_do_srh() 428 err = seg6_do_srh_encap(skb, tinfo->srh, in seg6_do_srh() 431 err = seg6_do_srh_encap_red(skb, tinfo->srh, in seg6_do_srh() 661 if (!seg6_validate_srh(tuninfo->srh, tuninfo_len - sizeof(*tuninfo), false)) in seg6_build_state()
|
A D | exthdrs.c | 1397 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)opt->srcrt; in fl6_update_dst() local 1399 fl6->daddr = srh->segments[srh->segments_left]; in fl6_update_dst()
|
A D | ipv6_sockglue.c | 372 struct ipv6_sr_hdr *srh = in ipv6_set_opt_hdr() local 375 if (!seg6_validate_srh(srh, optlen, false)) in ipv6_set_opt_hdr()
|
/linux-6.3-rc2/include/net/ |
A D | seg6.h | 60 extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len, bool reduced); 76 struct ipv6_sr_hdr *srh; in seg6_get_daddr() local 79 srh = (struct ipv6_sr_hdr *)(skb->data + opt->srhoff); in seg6_get_daddr() 80 return &srh->segments[0]; in seg6_get_daddr()
|
A D | seg6_local.h | 22 struct ipv6_sr_hdr *srh; member
|
A D | seg6_hmac.h | 50 struct ipv6_sr_hdr *srh);
|
/linux-6.3-rc2/include/uapi/linux/ |
A D | rpl_iptunnel.h | 19 #define RPL_IPTUNNEL_SRH_SIZE(srh) (((srh)->hdrlen + 1) << 3) argument
|
A D | seg6_iptunnel.h | 29 struct ipv6_sr_hdr srh[]; member 32 #define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
|
A D | seg6.h | 47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
|
/linux-6.3-rc2/tools/include/uapi/linux/ |
A D | seg6.h | 47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
|
/linux-6.3-rc2/net/core/ |
A D | filter.c | 6208 err = seg6_do_srh_inline(skb, srh); in bpf_push_seg6_encap() 6294 struct ipv6_sr_hdr *srh = srh_state->srh; in BPF_CALL_4() local 6298 if (srh == NULL) in BPF_CALL_4() 6301 srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4)); in BPF_CALL_4() 6302 srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen); in BPF_CALL_4() 6338 srh_state->srh = NULL; in bpf_update_srh_state() 6424 struct ipv6_sr_hdr *srh = srh_state->srh; in BPF_CALL_3() local 6430 if (unlikely(srh == NULL)) in BPF_CALL_3() 6433 srh_tlvs = (void *)((unsigned char *)srh + sizeof(*srh) + in BPF_CALL_3() 6434 ((srh->first_segment + 1) << 4)); in BPF_CALL_3() [all …]
|