Home
last modified time | relevance | path

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

/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 …]
/linux/tools/testing/selftests/bpf/progs/
H A Dtest_lwt_seg6local.c58 struct ip6_srh_t *srh; in get_srh() local
79 srh = cursor_advance(cursor, sizeof(*srh)); in get_srh()
80 if ((void *)srh + sizeof(*srh) > data_end) in get_srh()
83 if (srh->type != 4) in get_srh()
86 return srh; in get_srh()
120 int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh, in is_valid_tlv_boundary() argument
128 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary()
130 cur_off = srh_off + sizeof(*srh) + in is_valid_tlv_boundary()
131 sizeof(struct ip6_addr_t) * (srh->first_segment + 1); in is_valid_tlv_boundary()
143 if (cur_off >= srh_off + ((srh->hdrlen + 1) << 3)) in is_valid_tlv_boundary()
[all …]
H A Dtest_seg6_loop.c58 struct ip6_srh_t *srh; in get_srh() local
79 srh = cursor_advance(cursor, sizeof(*srh)); in get_srh()
80 if ((void *)srh + sizeof(*srh) > data_end) in get_srh()
83 if (srh->type != 4) in get_srh()
86 return srh; in get_srh()
120 struct ip6_srh_t *srh, in is_valid_tlv_boundary() argument
129 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary()
131 cur_off = srh_off + sizeof(*srh) + in is_valid_tlv_boundary()
132 sizeof(struct ip6_addr_t) * (srh->first_segment + 1); in is_valid_tlv_boundary()
146 if (cur_off >= srh_off + ((srh->hdrlen + 1) << 3)) in is_valid_tlv_boundary()
[all …]
/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->rpl_segaddr[srh->segments_left - 1]) & in rpl_validate_srh()
74 struct ipv6_rpl_sr_hdr *srh; in rpl_build_state() local
[all …]
H A Dseg6.c26 bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len, bool reduced) in seg6_validate_srh() argument
32 if (srh->type != IPV6_SRCRT_TYPE_4) in seg6_validate_srh()
35 if (((srh->hdrlen + 1) << 3) != len) in seg6_validate_srh()
38 if (!reduced && srh->segments_left > srh->first_segment) { in seg6_validate_srh()
41 max_last_entry = (srh->hdrlen / 2) - 1; in seg6_validate_srh()
43 if (srh->first_segment > max_last_entry) in seg6_validate_srh()
46 if (srh->segments_left > srh->first_segment + 1) in seg6_validate_srh()
50 tlv_offset = sizeof(*srh) + ((srh->first_segment + 1) << 4); in seg6_validate_srh()
63 tlv = (struct sr6_tlv *)((unsigned char *)srh + tlv_offset); in seg6_validate_srh()
78 struct ipv6_sr_hdr *srh; in seg6_get_srh() local
[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
248 srh = (struct ipv6_sr_hdr *)skb_transport_header(skb); in seg6_hmac_validate_skb()
250 tlv = seg6_get_tlv_hmac(srh); in seg6_hmac_validate_skb()
271 if (seg6_hmac_compute(hinfo, srh, in seg6_hmac_validate_skb()
328 seg6_push_hmac(struct net * net,struct in6_addr * saddr,struct ipv6_sr_hdr * srh) seg6_push_hmac() argument
[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()
693 if (!seg6_validate_srh(tuninfo->srh, tuninfo_len - sizeof(*tuninfo), false)) in seg6_build_state()
H A Dexthdrs.c1367 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)opt->srcrt; in fl6_update_dst() local
1369 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()
/linux/include/net/
H A Dseg6.h67 extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len, bool reduced);
83 struct ipv6_sr_hdr *srh; in seg6_get_daddr() local
86 srh = (struct ipv6_sr_hdr *)(skb->data + opt->srhoff); in seg6_get_daddr()
87 return &srh->segments[0]; in seg6_get_daddr()
H A Dseg6_local.h23 struct ipv6_sr_hdr *srh; member
H A Dseg6_hmac.h50 struct ipv6_sr_hdr *srh);
/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
/linux/tools/include/uapi/linux/
H A Dseg6.h47 #define sr_has_hmac(srh) ((srh)->flags & SR6_FLAG1_HMAC) argument
/linux/net/core/
H A Dfilter.c6397 struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)hdr; in bpf_push_seg6_encap() local
6399 if (!seg6_validate_srh(srh, len, false)) in bpf_push_seg6_encap()
6407 err = seg6_do_srh_inline(skb, srh); in bpf_push_seg6_encap()
6412 err = seg6_do_srh_encap(skb, srh, IPPROTO_IPV6); in bpf_push_seg6_encap()
6493 struct ipv6_sr_hdr *srh = srh_state->srh; in BPF_CALL_4() local
6498 if (srh == NULL) in BPF_CALL_4()
6501 srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4)); in BPF_CALL_4()
6502 srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen); in BPF_CALL_4()
6507 else if (ptr < (void *)&srh->flags || in BPF_CALL_4()
6508 ptr + len > (void *)&srh->segments) in BPF_CALL_4()
[all …]