1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/ipv6.h>
3 #include <net/dsfield.h>
9 static inline void xfrm6_beet_make_header(struct sk_buff
*skb
)
11 struct ipv6hdr
*iph
= ipv6_hdr(skb
);
15 memcpy(iph
->flow_lbl
, XFRM_MODE_SKB_CB(skb
)->flow_lbl
,
16 sizeof(iph
->flow_lbl
));
17 iph
->nexthdr
= XFRM_MODE_SKB_CB(skb
)->protocol
;
19 ipv6_change_dsfield(iph
, 0, XFRM_MODE_SKB_CB(skb
)->tos
);
20 iph
->hop_limit
= XFRM_MODE_SKB_CB(skb
)->ttl
;
23 static inline void xfrm4_beet_make_header(struct sk_buff
*skb
)
25 struct iphdr
*iph
= ip_hdr(skb
);
30 iph
->protocol
= XFRM_MODE_SKB_CB(skb
)->protocol
;
31 iph
->tos
= XFRM_MODE_SKB_CB(skb
)->tos
;
33 iph
->id
= XFRM_MODE_SKB_CB(skb
)->id
;
34 iph
->frag_off
= XFRM_MODE_SKB_CB(skb
)->frag_off
;
35 iph
->ttl
= XFRM_MODE_SKB_CB(skb
)->ttl
;