diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-02-28 07:50:39 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-02-28 07:50:39 +0100 |
commit | 0614621d89c43ea5b28456c2baf6b0c0e00ca81e (patch) | |
tree | 2dff833e972bdb65d30cb317985a0d41d2c40f0e /net/l2tp/l2tp_core.h | |
parent | 0cf264b3133dce56a60ca8b4335d1f76fe26870a (diff) | |
parent | 7d762d69145a54d169f58e56d6dac57a5508debc (diff) |
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/l2tp/l2tp_core.h')
-rw-r--r-- | net/l2tp/l2tp_core.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h index 9c9afe94d389..b2ce90260c35 100644 --- a/net/l2tp/l2tp_core.h +++ b/net/l2tp/l2tp_core.h @@ -301,6 +301,26 @@ static inline bool l2tp_tunnel_uses_xfrm(const struct l2tp_tunnel *tunnel) } #endif +static inline int l2tp_v3_ensure_opt_in_linear(struct l2tp_session *session, struct sk_buff *skb, + unsigned char **ptr, unsigned char **optr) +{ + int opt_len = session->peer_cookie_len + l2tp_get_l2specific_len(session); + + if (opt_len > 0) { + int off = *ptr - *optr; + + if (!pskb_may_pull(skb, off + opt_len)) + return -1; + + if (skb->data != *optr) { + *optr = skb->data; + *ptr = skb->data + off; + } + } + + return 0; +} + #define l2tp_printk(ptr, type, func, fmt, ...) \ do { \ if (((ptr)->debug) & (type)) \ |