On Sun, Jan 14, 2018 at 03:50:56PM +0100, Lorenzo Bianconi wrote: > --- a/net/l2tp/l2tp_core.h > +++ b/net/l2tp/l2tp_core.h > @@ -302,6 +302,17 @@ static inline void l2tp_session_dec_refcount(struct > l2tp_session *session) > l2tp_session_free(session); > } > > +static inline int l2tp_get_l2specific_len(struct l2tp_session *session) > +{ > + switch (session->l2specific_type) { > + case L2TP_L2SPECTYPE_NONE: > + return 0; > + case L2TP_L2SPECTYPE_DEFAULT: > + default: > + return 4; > + } > +} > The data path only compares ->l2specific_type to L2SPECTYPE_DEFAULT and treats any other value as L2SPECTYPE_NONE. Therefore, we should keep this logic here and return 0 for unknown types.
- [PATCH v2 net-next 0/5] l2tp: set l2specific_len based on... Lorenzo Bianconi
- [PATCH v2 net-next 3/5] l2tp: remove l2specific_len ... Lorenzo Bianconi
- Re: [PATCH v2 net-next 3/5] l2tp: remove l2speci... Guillaume Nault
- Re: [PATCH v2 net-next 3/5] l2tp: remove l2s... Lorenzo Bianconi
- Re: [PATCH v2 net-next 3/5] l2tp: remove... Guillaume Nault
- Re: [PATCH v2 net-next 3/5] l2tp: r... Lorenzo Bianconi
- Re: [PATCH v2 net-next 3/5] l2t... Guillaume Nault
- [PATCH v2 net-next 5/5] l2tp: mark L2TP_ATTR_L2SPEC_... Lorenzo Bianconi
- [PATCH v2 net-next 4/5] l2tp: remove l2specific_len ... Lorenzo Bianconi
- [PATCH v2 net-next 1/5] l2tp: fix switch default err... Lorenzo Bianconi
- Re: [PATCH v2 net-next 1/5] l2tp: fix switch def... Guillaume Nault
- Re: [PATCH v2 net-next 1/5] l2tp: fix switch... Lorenzo Bianconi
- Re: [PATCH v2 net-next 1/5] l2tp: fix sw... James Chapman