diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2017-12-22 17:10:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-27 20:11:51 +0300 |
commit | f15bc54eeecd86dfba3885aab839cd1f45172a38 (patch) | |
tree | b0ce5e53ca229d324ba653f64b9cc4ac34dd8e4b /net/l2tp/l2tp_core.c | |
parent | 820da5357572715c6235ba3b3daa2d5b43a1198f (diff) | |
download | linux-f15bc54eeecd86dfba3885aab839cd1f45172a38.tar.xz |
l2tp: add peer_offset parameter
Introduce peer_offset parameter in order to add the capability
to specify two different values for payload offset on tx/rx side.
If just offset is provided by userspace use it for rx side as well
in order to maintain compatibility with older l2tp versions
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_core.c')
-rw-r--r-- | net/l2tp/l2tp_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 115918ad8eca..6ff64717da1e 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -792,7 +792,7 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb, ptr += 2 + offset; } } else - ptr += session->offset; + ptr += session->peer_offset; offset = ptr - optr; if (!pskb_may_pull(skb, offset)) @@ -1785,6 +1785,7 @@ struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_tunnel *tunn session->lns_mode = cfg->lns_mode; session->reorder_timeout = cfg->reorder_timeout; session->offset = cfg->offset; + session->peer_offset = cfg->peer_offset; session->l2specific_type = cfg->l2specific_type; session->l2specific_len = cfg->l2specific_len; session->cookie_len = cfg->cookie_len; |