Home
last modified time | relevance | path

Searched refs:srh (Results 1 – 18 of 18) sorted by relevance

/Linux-v5.4/net/ipv6/netfilter/
Dip6t_srh.c27 struct ipv6_sr_hdr *srh; in srh_mt6() local
33 srh = skb_header_pointer(skb, srhoff, sizeof(_srh), &_srh); in srh_mt6()
34 if (!srh) in srh_mt6()
37 hdrlen = ipv6_optlen(srh); in srh_mt6()
41 if (srh->type != IPV6_SRCRT_TYPE_4) in srh_mt6()
44 if (srh->segments_left > srh->first_segment) in srh_mt6()
50 !(srh->nexthdr == srhinfo->next_hdr))) in srh_mt6()
56 !(srh->hdrlen == srhinfo->hdr_len))) in srh_mt6()
61 !(srh->hdrlen > srhinfo->hdr_len))) in srh_mt6()
66 !(srh->hdrlen < srhinfo->hdr_len))) in srh_mt6()
[all …]
DKconfig173 tristate '"srh" Segment Routing header match support'
176 srh matching allows you to match packets based on the segment
/Linux-v5.4/tools/testing/selftests/bpf/progs/
Dtest_lwt_seg6local.c56 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 int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh, in is_valid_tlv_boundary() argument
126 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary()
128 cur_off = srh_off + sizeof(*srh) + in is_valid_tlv_boundary()
129 sizeof(struct ip6_addr_t) * (srh->first_segment + 1); in is_valid_tlv_boundary()
141 if (cur_off >= srh_off + ((srh->hdrlen + 1) << 3)) in is_valid_tlv_boundary()
[all …]
Dtest_seg6_loop.c56 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
127 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary()
129 cur_off = srh_off + sizeof(*srh) + in is_valid_tlv_boundary()
130 sizeof(struct ip6_addr_t) * (srh->first_segment + 1); in is_valid_tlv_boundary()
142 if (cur_off >= srh_off + ((srh->hdrlen + 1) << 3)) in is_valid_tlv_boundary()
[all …]
/Linux-v5.4/net/ipv6/
Dseg6_local.c49 struct ipv6_sr_hdr *srh; member
68 struct ipv6_sr_hdr *srh; in get_srh() local
74 if (!pskb_may_pull(skb, srhoff + sizeof(*srh))) in get_srh()
77 srh = (struct ipv6_sr_hdr *)(skb->data + srhoff); in get_srh()
79 len = (srh->hdrlen + 1) << 3; in get_srh()
87 srh = (struct ipv6_sr_hdr *)(skb->data + srhoff); in get_srh()
89 if (!seg6_validate_srh(srh, len)) in get_srh()
92 return srh; in get_srh()
97 struct ipv6_sr_hdr *srh; in get_and_validate_srh() local
99 srh = get_srh(skb); in get_and_validate_srh()
[all …]
Dseg6_hmac.c86 static struct sr6_tlv_hmac *seg6_get_tlv_hmac(struct ipv6_sr_hdr *srh) in seg6_get_tlv_hmac() argument
90 if (srh->hdrlen < (srh->first_segment + 1) * 2 + 5) in seg6_get_tlv_hmac()
93 if (!sr_has_hmac(srh)) in seg6_get_tlv_hmac()
97 ((char *)srh + ((srh->hdrlen + 1) << 3) - 40); in seg6_get_tlv_hmac()
244 struct ipv6_sr_hdr *srh; in seg6_hmac_validate_skb() local
249 srh = (struct ipv6_sr_hdr *)skb_transport_header(skb); in seg6_hmac_validate_skb()
251 tlv = seg6_get_tlv_hmac(srh); in seg6_hmac_validate_skb()
271 if (seg6_hmac_compute(hinfo, srh, &ipv6_hdr(skb)->saddr, hmac_output)) in seg6_hmac_validate_skb()
328 struct ipv6_sr_hdr *srh) in seg6_push_hmac() argument
334 tlv = seg6_get_tlv_hmac(srh); in seg6_push_hmac()
[all …]
Dseg6.c28 bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len) in seg6_validate_srh() argument
33 if (srh->type != IPV6_SRCRT_TYPE_4) in seg6_validate_srh()
36 if (((srh->hdrlen + 1) << 3) != len) in seg6_validate_srh()
39 if (srh->segments_left > srh->first_segment) in seg6_validate_srh()
42 tlv_offset = sizeof(*srh) + ((srh->first_segment + 1) << 4); in seg6_validate_srh()
55 tlv = (struct sr6_tlv *)((unsigned char *)srh + tlv_offset); in seg6_validate_srh()
Dseg6_iptunnel.c237 err = seg6_do_srh_inline(skb, tinfo->srh); in seg6_do_srh()
253 err = seg6_do_srh_encap(skb, tinfo->srh, proto); in seg6_do_srh()
271 err = seg6_do_srh_encap(skb, tinfo->srh, NEXTHDR_NONE); in seg6_do_srh()
429 if (!seg6_validate_srh(tuninfo->srh, tuninfo_len - sizeof(*tuninfo))) in seg6_build_state()
Dexthdrs.c1157 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)opt->srcrt; in fl6_update_dst() local
1159 fl6->daddr = srh->segments[srh->segments_left]; in fl6_update_dst()
Dipv6_sockglue.c452 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *) in do_ipv6_setsockopt() local
455 if (!seg6_validate_srh(srh, optlen)) in do_ipv6_setsockopt()
/Linux-v5.4/include/uapi/linux/
Dseg6_iptunnel.h29 struct ipv6_sr_hdr srh[0]; member
32 #define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
56 return ((tuninfo->srh->hdrlen + 1) << 3) + head; in seg6_lwt_headroom()
Dseg6.h47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
/Linux-v5.4/tools/include/uapi/linux/
Dseg6.h47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
/Linux-v5.4/include/net/
Dseg6_local.h22 struct ipv6_sr_hdr *srh; member
Dseg6_hmac.h50 struct ipv6_sr_hdr *srh);
Dseg6.h60 extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len);
/Linux-v5.4/net/core/
Dfilter.c4922 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)hdr; in bpf_push_seg6_encap() local
4924 if (!seg6_validate_srh(srh, len)) in bpf_push_seg6_encap()
4932 err = seg6_do_srh_inline(skb, srh); in bpf_push_seg6_encap()
4937 err = seg6_do_srh_encap(skb, srh, IPPROTO_IPV6); in bpf_push_seg6_encap()
5019 struct ipv6_sr_hdr *srh = srh_state->srh; in BPF_CALL_4() local
5023 if (srh == NULL) in BPF_CALL_4()
5026 srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4)); in BPF_CALL_4()
5027 srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen); in BPF_CALL_4()
5032 else if (ptr < (void *)&srh->flags || in BPF_CALL_4()
5033 ptr + len > (void *)&srh->segments) in BPF_CALL_4()
[all …]
/Linux-v5.4/Documentation/ide/
DChangeLog.ide-cd.1994-200436 * Richard Hirst <srh@gpt.co.uk> for diagnosing this.