Message ID | 312a6bb7-4ae4-7fb8-7d99-7765099bd5d6@tessares.net |
---|---|
State | Superseded, archived |
Headers | show |
Series | Re: [PATCH] mptcp: fix option length of mp_capable syn/ack | expand |
On Sat, 2019-11-30 at 09:55 +0100, Matthieu Baerts wrote: > Hi Davide, [...] > > diff --git a/net/mptcp/options.c b/net/mptcp/options.c > > index 98eb0281d196..cee5c3968741 100644 > > --- a/net/mptcp/options.c > > +++ b/net/mptcp/options.c > > @@ -57,7 +57,7 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize, > > Here above, you also need to replace TCPOLEN_MPTCP_MPC_SYNACK by > TCPOLEN_MPTCP_MPC_ACK: > > === > diff --git a/net/mptcp/options.c b/net/mptcp/options.c > index 98eb0281d196..9163fddf16b9 100644 > --- a/net/mptcp/options.c > +++ b/net/mptcp/options.c > @@ -25,7 +25,7 @@ void mptcp_parse_option(const unsigned char *ptr, int > opsize, > */ > case MPTCPOPT_MP_CAPABLE: > if (opsize != TCPOLEN_MPTCP_MPC_SYN && > - opsize != TCPOLEN_MPTCP_MPC_SYNACK) > + opsize != TCPOLEN_MPTCP_MPC_ACK) > break; > > mp_opt->version = *ptr++ & MPTCP_VERSION_MASK; > === > > (or check that the size is not one of the three: I guess (but to be > confirmed) that the compiler will remove one check if we compare exactly > the same thing: opsize != 12 && opsize != 12 && opsize != 20) > Otherwise you will never match the if-statement here below. you are right, will fix this in v3. > --- a/net/mptcp/protocol.h > > +++ b/net/mptcp/protocol.h > > @@ -34,7 +34,7 @@ > > > > /* MPTCP suboption lengths */ > > #define TCPOLEN_MPTCP_MPC_SYN 12 > > -#define TCPOLEN_MPTCP_MPC_SYNACK 20 > > +#define TCPOLEN_MPTCP_MPC_SYNACK 12 > > Should we remove it if we don't use it? > Or rename 'TCPOLEN_MPTCP_MPC_SYN' to 'TCPOLEN_MPTCP_MPC_SYN_AND_SYNACK'? yes, it can be removed - but it's going to return very soon, with the same value, with v1 protocol. I'm for preserving the testability with tcpdump/packetdrill in v0 changing the lowest possible number of lines.
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 98eb0281d196..9163fddf16b9 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -25,7 +25,7 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize, */ case MPTCPOPT_MP_CAPABLE: if (opsize != TCPOLEN_MPTCP_MPC_SYN && - opsize != TCPOLEN_MPTCP_MPC_SYNACK) + opsize != TCPOLEN_MPTCP_MPC_ACK) break;