From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH v2 1/2] mptcp: reduce number of pr_debug() calls.
Date: Tue, 11 Jun 2019 10:51:47 -0700 [thread overview]
Message-ID: <20190611175148.11832-2-peter.krystad@linux.intel.com> (raw)
In-Reply-To: 20190611175148.11832-1-peter.krystad@linux.intel.com
[-- Attachment #1: Type: text/plain, Size: 2308 bytes --]
squashto: Handle MPTCP TCP options
Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
net/mptcp/options.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 1bee4a267fd8..a6ab6cef4a44 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -13,7 +13,7 @@
void mptcp_parse_option(const unsigned char *ptr, int opsize,
struct tcp_options_received *opt_rx)
{
- struct mptcp_options_received *mp_opt;
+ struct mptcp_options_received *mp_opt = &opt_rx->mptcp;
u8 subtype = *ptr >> 4;
int expected_opsize;
@@ -29,25 +29,28 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
opsize != TCPOLEN_MPTCP_MPC_SYNACK)
break;
- pr_debug("MP_CAPABLE");
- opt_rx->mptcp.version = *ptr++ & MPTCPOPT_VERSION_MASK;
- if (opt_rx->mptcp.version != 0)
+ mp_opt->version = *ptr++ & MPTCPOPT_VERSION_MASK;
+ if (mp_opt->version != 0)
break;
- pr_debug("flags=%02x", *ptr);
- opt_rx->mptcp.flags = *ptr++;
- if (!((opt_rx->mptcp.flags & MPTCP_CAP_FLAG_MASK) == MPTCP_CAP_HMAC_SHA1) ||
- (opt_rx->mptcp.flags & MPTCP_CAP_EXTENSIBILITY))
+ mp_opt->flags = *ptr++;
+ if (!((mp_opt->flags & MPTCP_CAP_FLAG_MASK) == MPTCP_CAP_HMAC_SHA1) ||
+ (mp_opt->flags & MPTCP_CAP_EXTENSIBILITY))
break;
- opt_rx->mptcp.mp_capable = 1;
- opt_rx->mptcp.sndr_key = get_unaligned_be64(ptr);
- pr_debug("sndr_key=%llu", opt_rx->mptcp.sndr_key);
+ mp_opt->mp_capable = 1;
+ mp_opt->sndr_key = get_unaligned_be64(ptr);
ptr += 8;
+
if (opsize == TCPOLEN_MPTCP_MPC_SYNACK) {
- opt_rx->mptcp.rcvr_key = get_unaligned_be64(ptr);
- pr_debug("rcvr_key=%llu", opt_rx->mptcp.rcvr_key);
+ mp_opt->rcvr_key = get_unaligned_be64(ptr);
ptr += 8;
+ pr_debug("MP_CAPABLE flags=%x, sndr=%llu, rcvr=%llu",
+ mp_opt->flags, mp_opt->sndr_key,
+ mp_opt->rcvr_key);
+ } else {
+ pr_debug("MP_CAPABLE flags=%x, sndr=%llu",
+ mp_opt->flags, mp_opt->sndr_key);
}
break;
@@ -83,7 +86,6 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
*/
case MPTCPOPT_DSS:
pr_debug("DSS");
- mp_opt = &opt_rx->mptcp;
mp_opt->dss = 1;
ptr++;
--
2.17.2
next reply other threads:[~2019-06-11 17:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-11 17:51 Peter Krystad [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-06-11 20:56 [MPTCP] [PATCH v2 1/2] mptcp: reduce number of pr_debug() calls Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190611175148.11832-2-peter.krystad@linux.intel.com \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.