Home
last modified time | relevance | path

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

/openbmc/linux/net/ipv6/netfilter/
H A 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 …]
H A DKconfig168 tristate '"srh" Segment Routing header match support'
171 srh matching allows you to match packets based on the segment
/openbmc/linux/tools/testing/selftests/bpf/progs/
H A 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 …]
H A 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()
144 if (cur_off >= srh_off + ((srh->hdrlen + 1) << 3)) in is_valid_tlv_boundary()
[all …]
/openbmc/linux/net/ipv6/
H A Drpl_iptunnel.c16 DECLARE_FLEX_ARRAY(struct ipv6_rpl_sr_hdr, srh);
39 static bool rpl_validate_srh(struct net *net, struct ipv6_rpl_sr_hdr *srh, in rpl_validate_srh() argument
44 if ((srh->hdrlen << 3) != seglen) in rpl_validate_srh()
48 if (!srh->segments_left || in rpl_validate_srh()
49 (srh->segments_left * sizeof(struct in6_addr)) != seglen) in rpl_validate_srh()
52 if (srh->cmpri || srh->cmpre) in rpl_validate_srh()
55 err = ipv6_chk_rpl_srh_loop(net, srh->rpl_segaddr, in rpl_validate_srh()
56 srh->segments_left); in rpl_validate_srh()
60 if (ipv6_addr_type(&srh in rpl_validate_srh()
74 struct ipv6_rpl_sr_hdr *srh; rpl_build_state() local
128 rpl_do_srh_inline(struct sk_buff * skb,const struct rpl_lwt * rlwt,const struct ipv6_rpl_sr_hdr * srh) rpl_do_srh_inline() argument
[all...]
H A Dseg6.c28 bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len, bool reduced) in seg6_validate_srh() argument
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()
43 max_last_entry = (srh->hdrlen / 2) - 1; in seg6_validate_srh()
45 if (srh->first_segment > max_last_entry) 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()
65 tlv = (struct sr6_tlv *)((unsigned char *)srh + tlv_offset); in seg6_validate_srh()
80 struct ipv6_sr_hdr *srh; in seg6_get_srh() local
[all …]
H A Dseg6_local.c189 struct ipv6_sr_hdr *srh; member
218 struct ipv6_sr_hdr *srh; in get_and_validate_srh() local
220 srh = seg6_get_srh(skb, IP6_FH_F_SKIP_RH); in get_and_validate_srh()
221 if (!srh) in get_and_validate_srh()
229 return srh; in get_and_validate_srh()
234 struct ipv6_sr_hdr *srh; in decap_and_validate() local
237 srh = seg6_get_srh(skb, 0); in decap_and_validate()
238 if (srh && srh->segments_left > 0) in decap_and_validate()
242 if (srh && !seg6_hmac_validate_skb(skb)) in decap_and_validate()
262 static void advance_nextseg(struct ipv6_sr_hdr *srh, struct in6_addr *daddr) in advance_nextseg() argument
[all …]
H A Dseg6_hmac.c84 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 …]
H A Dseg6_iptunnel.c47 return ((tuninfo->srh->hdrlen + 1) << 3) + head; in seg6_lwt_headroom()
393 err = __seg6_do_srh_inline(skb, tinfo->srh, cache_dst); in seg6_do_srh()
411 err = __seg6_do_srh_encap(skb, tinfo->srh, in seg6_do_srh()
414 err = seg6_do_srh_encap_red(skb, tinfo->srh, in seg6_do_srh()
436 err = __seg6_do_srh_encap(skb, tinfo->srh, in seg6_do_srh()
440 err = seg6_do_srh_encap_red(skb, tinfo->srh, in seg6_do_srh()
688 if (!seg6_validate_srh(tuninfo->srh, tuninfo_len - sizeof(*tuninfo), false))
H A Dexthdrs.c1369 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)opt->srcrt; in fl6_update_dst() local
1371 fl6->daddr = srh->segments[srh->segments_left]; in fl6_update_dst()
H A Dipv6_sockglue.c371 struct ipv6_sr_hdr *srh = in ipv6_set_opt_hdr() local
374 if (!seg6_validate_srh(srh, optlen, false)) in ipv6_set_opt_hdr()
/openbmc/linux/include/net/
H A Dseg6.h60 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()
H A Dseg6_local.h22 struct ipv6_sr_hdr *srh; member
H A Dseg6_hmac.h50 struct ipv6_sr_hdr *srh);
/openbmc/linux/include/uapi/linux/
H A Drpl_iptunnel.h19 #define RPL_IPTUNNEL_SRH_SIZE(srh) (((srh)->hdrlen + 1) << 3) argument
H A Dseg6_iptunnel.h29 struct ipv6_sr_hdr srh[]; member
32 #define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
H A Dseg6.h47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
/openbmc/linux/tools/include/uapi/linux/
H A Dseg6.h47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
/openbmc/linux/net/core/
H A Dfilter.c6346 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)hdr; in bpf_push_seg6_encap() local
6348 if (!seg6_validate_srh(srh, len, false)) in bpf_push_seg6_encap()
6356 err = seg6_do_srh_inline(skb, srh); in bpf_push_seg6_encap()
6361 err = seg6_do_srh_encap(skb, srh, IPPROTO_IPV6); in bpf_push_seg6_encap()
6442 struct ipv6_sr_hdr *srh = srh_state->srh; in BPF_CALL_4() local
6446 if (srh == NULL) in BPF_CALL_4()
6449 srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4)); in BPF_CALL_4()
6450 srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen); in BPF_CALL_4()
6455 else if (ptr < (void *)&srh->flags || in BPF_CALL_4()
6456 ptr + len > (void *)&srh->segments) in BPF_CALL_4()
[all …]