diff options
author | Eric Dumazet <edumazet@google.com> | 2022-02-21 19:21:12 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-22 19:43:04 -0800 |
commit | 763087dab97547230a6807c865a6a5ae53a59247 (patch) | |
tree | 79056c3ccdf5d390d6ef1033af001d6978f0ca13 /include/linux/skbuff.h | |
parent | ipv6: tcp: consistently use MAX_TCP_HEADER (diff) | |
download | linux-763087dab97547230a6807c865a6a5ae53a59247.tar.gz linux-763087dab97547230a6807c865a6a5ae53a59247.tar.bz2 linux-763087dab97547230a6807c865a6a5ae53a59247.zip |
net: add skb_set_end_offset() helper
We have multiple places where this helper is convenient,
and plan using it in the following patch.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a3e90efe6586..115be7f73487 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1536,6 +1536,11 @@ static inline unsigned int skb_end_offset(const struct sk_buff *skb) { return skb->end; } + +static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset) +{ + skb->end = offset; +} #else static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) { @@ -1546,6 +1551,11 @@ static inline unsigned int skb_end_offset(const struct sk_buff *skb) { return skb->end - skb->head; } + +static inline void skb_set_end_offset(struct sk_buff *skb, unsigned int offset) +{ + skb->end = skb->head + offset; +} #endif /* Internal */ |