[MPTCP][PATCH mptcp-next 0/3] add tracepoints
by Geliang Tang
This patchset addressed issues 131, replace some/most pr_debug with trace
events. As Paolo suggested, we should add the tracepoints at "the packet
scheduler and the mapping status" first.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/131
Geliang Tang (3):
mptcp: add tracepoint for mptcp_subflow_get_send
mptcp: add tracepoint for get_mapping_status
mptcp: add tracepoint for subflow_check_data_avail
include/trace/events/mptcp.h | 122 +++++++++++++++++++++++++++++++++++
net/mptcp/protocol.c | 9 ++-
net/mptcp/subflow.c | 15 ++---
3 files changed, 132 insertions(+), 14 deletions(-)
create mode 100644 include/trace/events/mptcp.h
--
2.29.2
3 weeks, 4 days
[PATCH iproute2-next] mptcp: add support for port based endpoint
by Paolo Abeni
The feature is supported by the kernel since 5.11-net-next,
let's allow user-space to use it.
Just parse and dump an additional, per endpoint, u16 attribute
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
ip/ipmptcp.c | 16 ++++++++++++++--
man/man8/ip-mptcp.8 | 8 ++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
index e1ffafb3..5f659b59 100644
--- a/ip/ipmptcp.c
+++ b/ip/ipmptcp.c
@@ -17,7 +17,7 @@ static void usage(void)
{
fprintf(stderr,
"Usage: ip mptcp endpoint add ADDRESS [ dev NAME ] [ id ID ]\n"
- " [ FLAG-LIST ]\n"
+ " [ port NR ] [ FLAG-LIST ]\n"
" ip mptcp endpoint delete id ID\n"
" ip mptcp endpoint show [ id ID ]\n"
" ip mptcp endpoint flush\n"
@@ -97,6 +97,7 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n,
bool id_set = false;
__u32 index = 0;
__u32 flags = 0;
+ __u16 port = 0;
__u8 id = 0;
ll_init_map(&rth);
@@ -123,6 +124,10 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n,
if (!index)
invarg("device does not exist\n", ifname);
+ } else if (matches(*argv, "port") == 0) {
+ NEXT_ARG();
+ if (get_u16(&port, *argv, 0))
+ invarg("expected port", *argv);
} else if (get_addr(&address, *argv, AF_UNSPEC) == 0) {
addr_set = true;
} else {
@@ -145,6 +150,8 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n,
addattr32(n, MPTCP_BUFLEN, MPTCP_PM_ADDR_ATTR_FLAGS, flags);
if (index)
addattr32(n, MPTCP_BUFLEN, MPTCP_PM_ADDR_ATTR_IF_IDX, index);
+ if (port)
+ addattr16(n, MPTCP_BUFLEN, MPTCP_PM_ADDR_ATTR_PORT, port);
if (addr_set) {
int type;
@@ -181,8 +188,8 @@ static int print_mptcp_addrinfo(struct rtattr *addrinfo)
__u8 family = AF_UNSPEC, addr_attr_type;
const char *ifname;
unsigned int flags;
+ __u16 id, port;
int index;
- __u16 id;
parse_rtattr_nested(tb, MPTCP_PM_ADDR_ATTR_MAX, addrinfo);
@@ -196,6 +203,11 @@ static int print_mptcp_addrinfo(struct rtattr *addrinfo)
print_string(PRINT_ANY, "address", "%s ",
format_host_rta(family, tb[addr_attr_type]));
}
+ if (tb[MPTCP_PM_ADDR_ATTR_PORT]) {
+ port = rta_getattr_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]);
+ if (port)
+ print_uint(PRINT_ANY, "port", "port %u ", port);
+ }
if (tb[MPTCP_PM_ADDR_ATTR_ID]) {
id = rta_getattr_u8(tb[MPTCP_PM_ADDR_ATTR_ID]);
print_uint(PRINT_ANY, "id", "id %u ", id);
diff --git a/man/man8/ip-mptcp.8 b/man/man8/ip-mptcp.8
index ef8409ea..98cb93b9 100644
--- a/man/man8/ip-mptcp.8
+++ b/man/man8/ip-mptcp.8
@@ -20,6 +20,8 @@ ip-mptcp \- MPTCP path manager configuration
.ti -8
.BR "ip mptcp endpoint add "
.IR IFADDR
+.RB "[ " port
+.IR PORT " ]"
.RB "[ " dev
.IR IFNAME " ]"
.RB "[ " id
@@ -87,6 +89,12 @@ ip mptcp endpoint flush flush all existing MPTCP endpoints
.TE
.TP
+.IR PORT
+When a port number is specified, incoming MPTCP subflows for already
+established MPTCP sockets will be accepted on the specified port, regardless
+the original listener port accepting the first MPTCP subflow and/or
+this peer being actually on the client side.
+
.IR ID
is a unique numeric identifier for the given endpoint
--
2.26.2
1 month, 2 weeks
[MPTCP][PATCH v2 mptcp-next 0/3] remove id 0 address
by Geliang Tang
The RM_ADDR selftests will fail when the removing address id is 0:
copyfd_io_poll: poll timed out (events: POLLIN 1, POLLOUT 0)
copyfd_io_poll: poll timed out (events: POLLIN 1, POLLOUT 0)
client exit code 2, server 2
netns ns1-0-7z6ol9 socket stat for 10009:
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
netns ns2-0-7z6ol9 socket stat for 10009:
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
TIME-WAIT 0 0 10.0.2.2:33225 10.0.2.1:10009 timer:(timewait,26sec,0)
TIME-WAIT 0 0 10.0.4.2:44309 10.0.4.1:10009 timer:(timewait,26sec,0)
TIME-WAIT 0 0 10.0.3.2:53671 10.0.3.1:10009 timer:(timewait,26sec,0)
10 flush addresses syn[ ok ] - synack[ ok ] - ack[ ok ]
add[ ok ] - echo [ ok ]
rm [ ok ] - sf [ ok ]
This patchset fixed this bug.
v2:
- drop __mptcp_wr_shutdown in v1.
apply: export/20210222T184014
move to next addr and testcases
move to next addr when timeout
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/140
Geliang Tang (3):
mptcp: unify RM_ADDR and RM_SUBFLOW receiving
mptcp: skip closing the initial subsocket
DO-NOT-MERGE: mptcp: remove id 0 test
net/mptcp/pm_netlink.c | 94 +++++++++----------
.../testing/selftests/net/mptcp/mptcp_join.sh | 8 +-
2 files changed, 47 insertions(+), 55 deletions(-)
--
2.29.2
1 month, 2 weeks
[PATCH mptcp-next 0/3] selftests: mptcp: report more errors and details
by Matthieu Baerts
To help analysing unstable selftests, the scripts are now launching
'mptcp_connect' with a timeout in order to avoid stalled tests and print
more details if supported (patch 1).
'nstat' history is also cleared just before starting a test -- just in
case -- (patch 2) and more info is printed in case of errors in
mptcp_join.sh
Matthieu Baerts (3):
selftests: mptcp: launch mptcp_connect with timeout
selftests: mptcp: init nstat history
selftests: mptcp: dump more info on mpjoin errors
tools/testing/selftests/net/mptcp/diag.sh | 38 +++++++++++++++---
.../selftests/net/mptcp/mptcp_connect.sh | 22 +++++++++--
.../testing/selftests/net/mptcp/mptcp_join.sh | 39 +++++++++++++++----
.../selftests/net/mptcp/simult_flows.sh | 13 +++++--
4 files changed, 91 insertions(+), 21 deletions(-)
--
2.30.0
1 month, 2 weeks
[MPTCP][PATCH v3 mptcp-next 0/5] move to next addr when timeout
by Geliang Tang
v3:
- invoke lookup_subflow_by_daddr in mptcp_pm_nl_add_addr_received.
- add a new patch "drop argument port from mptcp_pm_announce_addr".
v2:
- invoke lookup_subflow_by_daddr in mptcp_pm_add_addr_received, not in
mptcp_pm_nl_add_addr_received.
- add a sanity check on cfg_do_w.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/151
Geliang Tang (5):
mptcp: drop argument port from mptcp_pm_announce_addr
mptcp: skip connecting the connected address
mptcp: move to next addr when timeout
selftests: mptcp: add cfg_do_w for cfg_remove
selftests: mptcp: timeout testcases for multi addresses
net/mptcp/pm.c | 6 ++--
net/mptcp/pm_netlink.c | 35 +++++++++++++++----
net/mptcp/protocol.h | 2 +-
.../selftests/net/mptcp/mptcp_connect.c | 10 ++++--
.../testing/selftests/net/mptcp/mptcp_join.sh | 26 ++++++++++++--
5 files changed, 64 insertions(+), 15 deletions(-)
--
2.29.2
1 month, 2 weeks
[Weekly meetings] MoM - 25th of February 2021
by Matthieu Baerts
Hello everyone,
Today, we just had our 137th meeting with Mat and Ossama (Intel),
Christoph (Apple), Davide and Florian (RedHat), Geliang (Xiaomi) and
myself (Tessares).
Thanks again for this new good meeting!
Here are the minutes of the meeting:
Accepted patches:
- The list of accepted patches can be seen on PatchWork:
https://patchwork.ozlabs.org/project/mptcp/list/?state=3
netdev (if mptcp ML is in cc) (Paolo Abeni):
1442383 [net,4/4] mptcp: do not wakeup listener for MPJ subflows
1442382 [net,3/4] mptcp: provide subflow aware release function
1442381 [net,2/4] mptcp: fix DATA_FIN generation on early shutdown
1442380 [net,1/4] mptcp: fix DATA_FIN processing for orphaned sockets
our repo (by: Florian Westphal, Geliang Tang, Paolo Abeni):
1443944 [v2,mptcp-net] mptcp: fix missing wakeup
1443895 [v2] mptcp: add mptcp reset option support
1443698 [v3,mptcp-next,5/5] selftests: mptcp: timeout testcases for
multi add...
1443697 [v3,mptcp-next,4/5] selftests: mptcp: add cfg_do_w for cfg_remove
1443696 [v3,mptcp-next,3/5] mptcp: move to next addr when timeout
1443695 [v3,mptcp-next,2/5] mptcp: skip connecting the connected address
1443694 [v3,mptcp-next,1/5] mptcp: drop argument port from
mptcp_pm_announce_...
1443206 [mptcp-next,3/3] mptcp: remove unneeded check on first subflow
1443203 [mptcp-next,2/3] mptcp: add active MPC mibs
1443205 [mptcp-next,1/3] mptcp: add mib for token creation fallback
1443197 [v2] mptcp: reset 'first' and ack_hint on subflow close
1442415 [mptcp-net] mptcp: fix memory accounting on allocation error
1441980 [v5,mptcp-next,3/3] selftests: mptcp: signal addresses testcases
1441979 [v5,mptcp-next,2/3] mptcp: move to next addr when subflow
creation fa...
1441978 [v5,mptcp-next,1/3] mptcp: export lookup_anno_list_by_saddr
1441703 [iproute2-next] mptcp: add support for port based endpoint:
- we don't maintain a local iproute2 fork.
1441645 [mptcp-net] mptcp: do not wakeup listener for MPJ subflows
1441518 [v2,mptcp-next] mptcp: free resources when the port number is
mismatc...
1441510 [v2,mptcp-next] Squash to "mptcp: add rm_list_tx in mptcp_pm_data"
1441262 mptcp: put subflow sock on connect error
Pending patches:
- The list of pending patches can be seen on PatchWork:
https://patchwork.ozlabs.org/project/mptcp/list/?state=*
netdev (if mptcp ML is in cc) (by: Paolo Abeni):
1442446 [iproute2-next] mptcp: add support for port based endpoint
our repo (by: Florian Westphal, Geliang Tang, Matthieu Baerts):
1370700: RFC: [RFC,2/4] tcp: move selected mptcp helpers to tcp.h/mptcp.h
1370702: RFC: [RFC,4/4] tcp: parse tcp options contained in reset packets:
- WIP
1375893: RFC: [RFC,mptpcp-next] mptcp: add ooo prune support:
- WIP
1395128: RFC: [1/5] tcp: make two mptcp helpers available to tcp stack
1395133: RFC: [5/5] mptcp: send fastclose if userspace closes socket
with unread data:
- one less: "mptcp: add mptcp reset option support" :-)
- WIP
1426554: Changes Requested: [PATCHi,iproute2] mptcp: add support for
event monitoring:
- WIP
1442954: New: [mptcp-next,1/3] mptcp: add tracepoint for
mptcp_subflow_get_send
1442956: New: [mptcp-next,2/3] mptcp: add tracepoint for get_mapping_status
1442957: New: [mptcp-next,3/3] mptcp: add tracepoint for
subflow_check_data_avail:
- v1 (after RFC): Review needed
- *@Paolo* : by chance, do you have some time to look at this one? :)
1443422: New: [v2,mptcp-next,1/3] mptcp: unify RM_ADDR and RM_SUBFLOW
receiving
1443423: New: [v2,mptcp-next,2/3] mptcp: skip closing the initial subsocket
1443424: New: [v2,mptcp-next,3/3] DO-NOT-MERGE: mptcp: remove id 0 test:
- v2: Review needed
- to remove id 0 address: if we receive ID 0
- but not to send RM_ADDR with ID 0
- *@Mat* would like to do some experiments
1443967: New: [mptcp-next,1/3] selftests: mptcp: launch mptcp_connect
with timeout
1443970: New: [mptcp-next,2/3] selftests: mptcp: init nstat history
1443968: New: [mptcp-next,3/3] selftests: mptcp: dump more info on
mpjoin errors:
- v1: Review needed
Issues on Github:
https://github.com/multipath-tcp/mptcp_net-next/issues/
Recently opened (latest from last week: 166)
169 packetdrill: add coverage for ADD_ADDR and MP_JOIN on a
different port [enhancement] [packetdrill]:
- linked to #54 → just to split kernel dev and packetdrill validation
168 [syzkaller] WARNING in dst_release [bug] [syzkaller]:
- no repro yet
167 packetdrill: add coverage for RM_ADDR [enhancement]
[packetdrill] @dcaratti:
- also to split kernel dev and packetdrill validation
Bugs (opened, flagged as "bug" and assigned)
160 `./mptcp_connect.sh -m mmap` test blocks [bug] @matttbe:
- can be closed because dup of #146
- we can wait for "selftests: mptcp: launch mptcp_connect with
timeout"
146 DATA_FIN is not retransmitted on timeout [bug] @mjmartineau:
- Mat is working on it
Bugs (opened and flagged as "bug" and not assigned)
168 [syzkaller] WARNING in dst_release [bug] [syzkaller]
162 sendmsg()/recvmsg() fail when an unknown CMSG argument is
provided [bug]
156 [syzkaller] WARNING: refcount bug in __tcp_transmit_skb [bug]
[syzkaller]
153 [syzkaller] WARNING: refcount bug in mptcp_incoming_options
[bug] [syzkaller]
137 selftests: simult_flows.sh: unbalanced bwidth tests are unstable
[bug]
120 [interop] netnext is dropping packets, causing MPTCP-level
retransmissions on mptcp.org [bug]
119 [syzkaller] memory leak in __get_filter [bug] [syzkaller]
107 Review use of WARN_ON() / WARN_ON_ONCE() [bug]
65 clearing properly the status in listen() [bug]
56 msk connection state set without msk lock [bug]:
- Maybe move these 3 in "features"?
- WDYT?
In Progress (opened and assigned)
167 packetdrill: add coverage for RM_ADDR [enhancement]
[packetdrill] @dcaratti:
- see above
166 iproute2: ADD_ADDR: ports support [enhancement] [iproute2] @pabeni
- patch has been sent, should we close?
158 iproute2: change backup mode (MP_PRIO) for active connections
[enhancement] [iproute2] @dcaratti
142 packetdrill: support injecting ADD_ADDR echo bit [enhancement]
[packetdrill] @dcaratti
140 RM_ADDR: remove a list of addresses [enhancement] @geliangtang:
- remaining bit: remove addr with ID 0 (+ packetdrill, see #167)
134 Checksum support [enhancement] @geliangtang:
- good progress from Geliang!
131 replace some/most pr_debug with trace events [enhancement]
@geliangtang
- See patches avove
96 Python: add support for IPPROTO_MPTCP [enhancement] @matttbe
53 MP_TCPRST support [enhancement] @fw-strlen:
- kernel code in the tree!
- packetdrill almost merged → see below
- iproute2 support needed? → no except for Netlink events? yes,
needs 4 lines patch, will send it soon
- Wireshark / TCPDump doesn't understand option subtype 8
52 MP_FAIL support [enhancement] @geliangtang
Recently closed (since last week)
165 Intermittent copyfd_io_poll: poll timed out in mptcp_join.sh
[bug] @pabeni
164 unexpected poll() wakeup on incoming MP_JOIN [bug] @pabeni
151 Only 1 ADD_ADDR has been sent when signalling multi invalid
addresses [bug] @geliangtang
136 [syzkaller] WARNING in sk_stream_kill_queues [bug] [syzkaller]
54 ADD_ADDR: ports support [enhancement] @geliangtang
FYI: Current Roadmap:
- Has been updated!
- Bugs: https://github.com/multipath-tcp/mptcp_net-next/projects/2
- Current/Coming merge window (5.13):
https://github.com/multipath-tcp/mptcp_net-next/projects/8
- For later: https://github.com/multipath-tcp/mptcp_net-next/projects/4
Wiki pages have been updated:
- Updated Changelog:
https://github.com/multipath-tcp/mptcp_net-next/wiki#changelog
- Reworked: https://github.com/multipath-tcp/mptcp_net-next/wiki/Status
- old part of "Status" has been archived:
https://github.com/multipath-tcp/mptcp_net-next/wiki/%5Barchived%5D-Status
Patches to send to netdev:
- net:
- some patches had conflicts when Paolo tried to send them last
week
- but now, -net has been sync with net-next, they should apply
without conflicts
- note: a few patches from our tree are already in -net but not
in net-next yet.
- Maybe easier to wait for net-next to sync with -net and then
send the patches we have in our tree that are for -net
- net-next:
- net-next is closed for the moment
Extra tests:
- news about Syzkaller? (Christoph):
- no other news that what was shared on github
- syzkaller still running
- news about interop with mptcp.org? (Christoph):
- /
- news about Intel's kbuild? (Mat):
- no update but tests are still running and more stable!
- all good then
- packetdrill (Davide):
- https://github.com/multipath-tcp/packetdrill/pull/44 :
- @Paolo: OK for you?
- https://github.com/multipath-tcp/packetdrill/pull/45 → to be
validated with last kernel:
- just merged
- https://github.com/multipath-tcp/packetdrill/pull/46 → is it
OK to receive a ADD_ADDR+echo before "fully established":
- @Christoph if you can look at the question please? :)
- Link:
https://github.com/multipath-tcp/packetdrill/pull/46/files/4eeb961b47a2f2...
- CI (Matth):
- more stable
- still looking at using GH Action
- + cirrus-ci
- + patchew
- + kernelci
- :)
Development statistics for the 5.11 kernel:
- https://lwn.net/Articles/845831/
- 2 members are cited!
- "Paolo Abeni and Florian Westphal both worked on the mostly
under-the-radar upstreaming of the multipath TCP code, which has been
long in coming."
- Nice work guys!
TopGit tree:
- proposition to add dedicated topics (commits) to structure the tree:
- [DO-NOT-MERGE] net-next → "below" is net-next
- [DO-NOT-MERGE] fixes-for-net → "below" is commits for -net
- [DO-NOT-MERGE] fixes-for-net-next → "below" is commits fixing
issues in net-next (but not in -net)
- [DO-NOT-MERGE] features-for-net-next → "below" is commits
adding new features (or small fixes) for net-next only
- sounds good and helpful!
- best to wait for net-next to sync with net before doing that!
BPF patches:
- Maybe best to park them?
- WDYT?
- not really had to keep them there, not impacting MPTCP code, will
see if they cause more issues
Next meeting:
- On Thursday, the 4th of March.
- Usual UTC time: 16:00 UTC (8am PST, 5pm CET, Midnight CST)
- Still open to everyone!
- https://annuel2.framapad.org/p/mptcp_upstreaming_20210304
Feel free to comment on these points and propose new ones for the next
meeting!
Talk to you on Thursday,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
1 month, 2 weeks
[PATCH v2] mptcp: add mptcp reset option support
by Florian Westphal
The MPTCP reset option allows to carry a mptcp-specific error code that
provides more information on the nature of a connection reset.
Reset option data received gets stored in the subflow context so it can
be sent to userspace via the 'subflow closed' netlink event.
When a subflow is closed, the desired error code that should be sent to
the peer is also placed in the subflow context structure.
If a reset is sent before subflow establishment could complete, e.g. on
HMAC failure during an MP_JOIN operation, the mptcp skb extension is
used to store the reset information.
Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
Changes since v1:
- send reset event if mp_reset had reason code 0 too
- avoid 3x repeat of skb_ext_add/memset/assignment
- place reason codes in uapi header
include/net/mptcp.h | 18 ++++++++--
include/uapi/linux/mptcp.h | 11 +++++++
net/ipv4/tcp_ipv4.c | 21 ++++++++++--
net/ipv6/tcp_ipv6.c | 14 +++++++-
net/mptcp/options.c | 67 +++++++++++++++++++++++++++++++++++---
net/mptcp/pm_netlink.c | 12 +++++++
net/mptcp/protocol.c | 12 +++++--
net/mptcp/protocol.h | 14 +++++++-
net/mptcp/subflow.c | 30 ++++++++++++++---
9 files changed, 180 insertions(+), 19 deletions(-)
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index cea69c801595..16fe34d139c3 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -30,8 +30,8 @@ struct mptcp_ext {
ack64:1,
mpc_map:1,
frozen:1,
- __unused:1;
- /* one byte hole */
+ reset_transient:1;
+ u8 reset_reason:4;
};
#define MPTCP_RM_IDS_MAX 8
@@ -58,6 +58,8 @@ struct mptcp_out_options {
struct mptcp_rm_list rm_list;
u8 join_id;
u8 backup;
+ u8 reset_reason:4;
+ u8 reset_transient:1;
u32 nonce;
u64 thmac;
u32 token;
@@ -156,6 +158,16 @@ void mptcp_seq_show(struct seq_file *seq);
int mptcp_subflow_init_cookie_req(struct request_sock *req,
const struct sock *sk_listener,
struct sk_buff *skb);
+
+__be32 mptcp_get_reset_option(const struct sk_buff *skb);
+
+static inline __be32 mptcp_reset_option(const struct sk_buff *skb)
+{
+ if (skb_ext_exist(skb, SKB_EXT_MPTCP))
+ return mptcp_get_reset_option(skb);
+
+ return htonl(0u);
+}
#else
static inline void mptcp_init(void)
@@ -236,6 +248,8 @@ static inline int mptcp_subflow_init_cookie_req(struct request_sock *req,
{
return 0; /* TCP fallback */
}
+
+static inline __be32 mptcp_reset_option(const struct sk_buff *skb) { return htonl(0u); }
#endif /* CONFIG_MPTCP */
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index e1172c1ffdfd..8eb3c0844bff 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -174,10 +174,21 @@ enum mptcp_event_attr {
MPTCP_ATTR_FLAGS, /* u16 */
MPTCP_ATTR_TIMEOUT, /* u32 */
MPTCP_ATTR_IF_IDX, /* s32 */
+ MPTCP_ATTR_RESET_REASON,/* u32 */
+ MPTCP_ATTR_RESET_FLAGS, /* u32 */
__MPTCP_ATTR_AFTER_LAST
};
#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
+/* MPTCP Reset reason codes, rfc8684 */
+#define MPTCP_RST_EUNSPEC 0
+#define MPTCP_RST_EMPTCP 1
+#define MPTCP_RST_ERESOURCE 2
+#define MPTCP_RST_EPROHIBIT 3
+#define MPTCP_RST_EWQ2BIG 4
+#define MPTCP_RST_EBADPERF 5
+#define MPTCP_RST_EMIDDLEBOX 6
+
#endif /* _UAPI_MPTCP_H */
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index daad4f99db32..e092c5a9dd1c 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -655,14 +655,18 @@ EXPORT_SYMBOL(tcp_v4_send_check);
* Exception: precedence violation. We do not implement it in any case.
*/
+#ifdef CONFIG_TCP_MD5SIG
+#define OPTION_BYTES TCPOLEN_MD5SIG_ALIGNED
+#else
+#define OPTION_BYTES sizeof(__be32)
+#endif
+
static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
{
const struct tcphdr *th = tcp_hdr(skb);
struct {
struct tcphdr th;
-#ifdef CONFIG_TCP_MD5SIG
- __be32 opt[(TCPOLEN_MD5SIG_ALIGNED >> 2)];
-#endif
+ __be32 opt[OPTION_BYTES / sizeof(__be32)];
} rep;
struct ip_reply_arg arg;
#ifdef CONFIG_TCP_MD5SIG
@@ -770,6 +774,17 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
ip_hdr(skb)->daddr, &rep.th);
}
#endif
+ /* Can't co-exist with TCPMD5, hence check rep.opt[0] */
+ if (rep.opt[0] == 0) {
+ __be32 mrst = mptcp_reset_option(skb);
+
+ if (mrst) {
+ rep.opt[0] = mrst;
+ arg.iov[0].iov_len += sizeof(mrst);
+ rep.th.doff = arg.iov[0].iov_len / 4;
+ }
+ }
+
arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
ip_hdr(skb)->saddr, /* XXX */
arg.iov[0].iov_len, IPPROTO_TCP, 0);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index bd44ded7e50c..a18d304fe1c9 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -879,8 +879,8 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
struct net *net = sk ? sock_net(sk) : dev_net(skb_dst(skb)->dev);
struct sock *ctl_sk = net->ipv6.tcp_sk;
unsigned int tot_len = sizeof(struct tcphdr);
+ __be32 mrst = 0, *topt;
struct dst_entry *dst;
- __be32 *topt;
__u32 mark = 0;
if (tsecr)
@@ -890,6 +890,15 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
tot_len += TCPOLEN_MD5SIG_ALIGNED;
#endif
+#ifdef CONFIG_MPTCP
+ if (rst && !key) {
+ mrst = mptcp_reset_option(skb);
+
+ if (mrst)
+ tot_len += sizeof(__be32);
+ }
+#endif
+
buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len,
GFP_ATOMIC);
if (!buff)
@@ -920,6 +929,9 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
*topt++ = htonl(tsecr);
}
+ if (mrst)
+ *topt++ = mrst;
+
#ifdef CONFIG_TCP_MD5SIG
if (key) {
*topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index c6a0d71e59d7..f95643d820fe 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -305,6 +305,18 @@ static void mptcp_parse_option(const struct sk_buff *skb,
mp_opt->fastclose = 1;
break;
+ case MPTCPOPT_RST:
+ if (opsize != TCPOLEN_MPTCP_RST)
+ break;
+
+ if (!(TCP_SKB_CB(skb)->tcp_flags & TCPHDR_RST))
+ break;
+ mp_opt->reset = 1;
+ flags = *ptr++;
+ mp_opt->reset_transient = flags & MPTCP_RST_TRANSIENT;
+ mp_opt->reset_reason = *ptr;
+ break;
+
default:
break;
}
@@ -327,6 +339,7 @@ void mptcp_get_options(const struct sk_buff *skb,
mp_opt->rm_addr = 0;
mp_opt->dss = 0;
mp_opt->mp_prio = 0;
+ mp_opt->reset = 0;
length = (th->doff * 4) - sizeof(struct tcphdr);
ptr = (const unsigned char *)(th + 1);
@@ -724,6 +737,22 @@ static bool mptcp_established_options_mp_prio(struct sock *sk,
return true;
}
+static noinline void mptcp_established_options_rst(struct sock *sk, struct sk_buff *skb,
+ unsigned int *size,
+ unsigned int remaining,
+ struct mptcp_out_options *opts)
+{
+ const struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
+
+ if (remaining < TCPOLEN_MPTCP_RST)
+ return;
+
+ *size = TCPOLEN_MPTCP_RST;
+ opts->suboptions |= OPTION_MPTCP_RST;
+ opts->reset_transient = subflow->reset_transient;
+ opts->reset_reason = subflow->reset_reason;
+}
+
bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
unsigned int *size, unsigned int remaining,
struct mptcp_out_options *opts)
@@ -739,11 +768,10 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
if (unlikely(__mptcp_check_fallback(msk)))
return false;
- /* prevent adding of any MPTCP related options on reset packet
- * until we support MP_TCPRST/MP_FASTCLOSE
- */
- if (unlikely(skb && TCP_SKB_CB(skb)->tcp_flags & TCPHDR_RST))
- return false;
+ if (unlikely(skb && TCP_SKB_CB(skb)->tcp_flags & TCPHDR_RST)) {
+ mptcp_established_options_rst(sk, skb, size, remaining, opts);
+ return true;
+ }
snd_data_fin = mptcp_data_fin_enabled(msk);
if (mptcp_established_options_mp(sk, skb, snd_data_fin, &opt_size, remaining, opts))
@@ -1058,6 +1086,12 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
mp_opt.mp_prio = 0;
}
+ if (mp_opt.reset) {
+ subflow->reset_seen = 1;
+ subflow->reset_reason = mp_opt.reset_reason;
+ subflow->reset_transient = mp_opt.reset_transient;
+ }
+
if (!mp_opt.dss)
return;
@@ -1285,6 +1319,12 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
ptr += 5;
}
+ if (OPTION_MPTCP_RST & opts->suboptions)
+ *ptr++ = mptcp_option(MPTCPOPT_RST,
+ TCPOLEN_MPTCP_RST,
+ opts->reset_transient,
+ opts->reset_reason);
+
if (opts->ext_copy.use_ack || opts->ext_copy.use_map) {
struct mptcp_ext *mpext = &opts->ext_copy;
u8 len = TCPOLEN_MPTCP_DSS_BASE;
@@ -1336,3 +1376,20 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
if (tp)
mptcp_set_rwin(tp);
}
+
+__be32 mptcp_get_reset_option(const struct sk_buff *skb)
+{
+ const struct mptcp_ext *ext = mptcp_get_ext(skb);
+ u8 flags, reason;
+
+ if (ext) {
+ flags = ext->reset_transient;
+ reason = ext->reset_reason;
+
+ return mptcp_option(MPTCPOPT_RST, TCPOLEN_MPTCP_RST,
+ flags, reason);
+ }
+
+ return htonl(0u);
+}
+EXPORT_SYMBOL_GPL(mptcp_get_reset_option);
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 55fdcb1b5281..3b99ae822318 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1648,9 +1648,21 @@ static int mptcp_event_sub_closed(struct sk_buff *skb,
const struct mptcp_sock *msk,
const struct sock *ssk)
{
+ const struct mptcp_subflow_context *sf;
+
if (mptcp_event_put_token_and_ssk(skb, msk, ssk))
return -EMSGSIZE;
+ sf = mptcp_subflow_ctx(ssk);
+ if (!sf->reset_seen)
+ return 0;
+
+ if (nla_put_u32(skb, MPTCP_ATTR_RESET_REASON, sf->reset_reason))
+ return -EMSGSIZE;
+
+ if (nla_put_u32(skb, MPTCP_ATTR_RESET_FLAGS, sf->reset_transient))
+ return -EMSGSIZE;
+
return 0;
}
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2859ad2c6990..e2388da9b320 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3090,14 +3090,18 @@ bool mptcp_finish_join(struct sock *ssk)
pr_debug("msk=%p, subflow=%p", msk, subflow);
/* mptcp socket already closing? */
- if (!mptcp_is_fully_established(parent))
+ if (!mptcp_is_fully_established(parent)) {
+ subflow->reset_reason = MPTCP_RST_EMPTCP;
return false;
+ }
if (!msk->pm.server_side)
goto out;
- if (!mptcp_pm_allow_new_subflow(msk))
+ if (!mptcp_pm_allow_new_subflow(msk)) {
+ subflow->reset_reason = MPTCP_RST_EPROHIBIT;
return false;
+ }
/* active connections are already on conn_list, and we can't acquire
* msk lock here.
@@ -3111,8 +3115,10 @@ bool mptcp_finish_join(struct sock *ssk)
sock_hold(ssk);
}
spin_unlock_bh(&msk->join_list_lock);
- if (!ret)
+ if (!ret) {
+ subflow->reset_reason = MPTCP_RST_EPROHIBIT;
return false;
+ }
/* attach to msk socket only after we are sure he will deal with us
* at close time
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 6af3e259fa05..285f44e35835 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -26,6 +26,7 @@
#define OPTION_MPTCP_RM_ADDR BIT(8)
#define OPTION_MPTCP_FASTCLOSE BIT(9)
#define OPTION_MPTCP_PRIO BIT(10)
+#define OPTION_MPTCP_RST BIT(11)
/* MPTCP option subtypes */
#define MPTCPOPT_MP_CAPABLE 0
@@ -36,6 +37,7 @@
#define MPTCPOPT_MP_PRIO 5
#define MPTCPOPT_MP_FAIL 6
#define MPTCPOPT_MP_FASTCLOSE 7
+#define MPTCPOPT_RST 8
/* MPTCP suboption lengths */
#define TCPOLEN_MPTCP_MPC_SYN 4
@@ -64,6 +66,7 @@
#define TCPOLEN_MPTCP_PRIO 3
#define TCPOLEN_MPTCP_PRIO_ALIGN 4
#define TCPOLEN_MPTCP_FASTCLOSE 12
+#define TCPOLEN_MPTCP_RST 4
/* MPTCP MP_JOIN flags */
#define MPTCPOPT_BACKUP BIT(0)
@@ -93,6 +96,9 @@
/* MPTCP MP_PRIO flags */
#define MPTCP_PRIO_BKUP BIT(0)
+/* MPTCP TCPRST flags */
+#define MPTCP_RST_TRANSIENT BIT(0)
+
/* MPTCP socket flags */
#define MPTCP_DATA_READY 0
#define MPTCP_NOSPACE 1
@@ -122,6 +128,7 @@ struct mptcp_options_received {
u16 mp_capable : 1,
mp_join : 1,
fastclose : 1,
+ reset : 1,
dss : 1,
add_addr : 1,
rm_addr : 1,
@@ -151,6 +158,8 @@ struct mptcp_options_received {
};
u64 ahmac;
u16 port;
+ u8 reset_reason:4;
+ u8 reset_transient:1;
};
static inline __be32 mptcp_option(u8 subopt, u8 len, u8 nib, u8 field)
@@ -421,6 +430,9 @@ struct mptcp_subflow_context {
u8 hmac[MPTCPOPT_HMAC_LEN];
u8 local_id;
u8 remote_id;
+ u8 reset_seen:1;
+ u8 reset_transient:1;
+ u8 reset_reason:4;
long delegated_status;
struct list_head delegated_node; /* link into delegated_action, protected by local BH */
@@ -737,7 +749,7 @@ unsigned int mptcp_pm_get_add_addr_accept_max(struct mptcp_sock *msk);
unsigned int mptcp_pm_get_subflows_max(struct mptcp_sock *msk);
unsigned int mptcp_pm_get_local_addr_max(struct mptcp_sock *msk);
-static inline struct mptcp_ext *mptcp_get_ext(struct sk_buff *skb)
+static inline struct mptcp_ext *mptcp_get_ext(const struct sk_buff *skb)
{
return (struct mptcp_ext *)skb_ext_find(skb, SKB_EXT_MPTCP);
}
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index d022893a5765..6af443a18bac 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -115,6 +115,16 @@ static bool subflow_use_different_sport(struct mptcp_sock *msk, const struct soc
return inet_sk(sk)->inet_sport != inet_sk((struct sock *)msk)->inet_sport;
}
+static void subflow_add_reset_reason(struct sk_buff *skb, u8 reason)
+{
+ struct mptcp_ext *mpext = skb_ext_add(skb, SKB_EXT_MPTCP);
+
+ if (mpext) {
+ memset(mpext, 0, sizeof(*mpext));
+ mpext->reset_reason = reason;
+ }
+}
+
/* Init mptcp request socket.
*
* Returns an error code if a JOIN has failed and a TCP reset
@@ -190,8 +200,10 @@ static int subflow_check_req(struct request_sock *req,
subflow_req->msk = subflow_token_join_request(req);
/* Can't fall back to TCP in this case. */
- if (!subflow_req->msk)
+ if (!subflow_req->msk) {
+ subflow_add_reset_reason(skb, MPTCP_RST_EMPTCP);
return -EPERM;
+ }
if (subflow_use_different_sport(subflow_req->msk, sk_listener)) {
pr_debug("syn inet_sport=%d %d",
@@ -400,8 +412,10 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
} else if (subflow->request_join) {
u8 hmac[SHA256_DIGEST_SIZE];
- if (!mp_opt.mp_join)
+ if (!mp_opt.mp_join) {
+ subflow->reset_reason = MPTCP_RST_EMPTCP;
goto do_reset;
+ }
subflow->thmac = mp_opt.thmac;
subflow->remote_nonce = mp_opt.nonce;
@@ -410,6 +424,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
if (!subflow_thmac_valid(subflow)) {
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINACKMAC);
+ subflow->reset_reason = MPTCP_RST_EMPTCP;
goto do_reset;
}
@@ -438,6 +453,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
return;
do_reset:
+ subflow->reset_transient = 0;
mptcp_subflow_reset(sk);
}
@@ -649,8 +665,10 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
* to reset the context to non MPTCP status.
*/
if (!ctx || fallback) {
- if (fallback_is_fatal)
+ if (fallback_is_fatal) {
+ subflow_add_reset_reason(skb, MPTCP_RST_EMPTCP);
goto dispose_child;
+ }
subflow_drop_ctx(child);
goto out;
@@ -685,8 +703,10 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
struct mptcp_sock *owner;
owner = subflow_req->msk;
- if (!owner)
+ if (!owner) {
+ subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
goto dispose_child;
+ }
/* move the msk reference ownership to the subflow */
subflow_req->msk = NULL;
@@ -1051,6 +1071,8 @@ static bool subflow_check_data_avail(struct sock *ssk)
smp_wmb();
ssk->sk_error_report(ssk);
tcp_set_state(ssk, TCP_CLOSE);
+ subflow->reset_transient = 0;
+ subflow->reset_reason = MPTCP_RST_EMPTCP;
tcp_send_active_reset(ssk, GFP_ATOMIC);
subflow->data_avail = 0;
return false;
--
2.26.2
1 month, 3 weeks
[PATCH v2 mptcp-net] mptcp: fix missing wakeup
by Paolo Abeni
__mptcp_clean_una() can free write memory and should wake-up
user-space processes when needed.
When such function is invoked by the MPTCP receive path, the wakeup
is not needed, as the TCP stack will later trigger subflow_write_space
which will do the wakeup as needed.
Other __mptcp_clean_una() call sites need an additional wakeup check
Let's bundle the relevant code in a new helper and use it.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/165
Fixes: 6e628cd3a8f7 ("mptcp: use mptcp release_cb for delayed tasks")
Fixes: 64b9cea7a0af ("mptcp: fix spurious retransmissions")
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
v1 -> v2:
- drop self-tests changes, slipped here due to PEBKAC
net/mptcp/protocol.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2859ad2c6990c..87f62fe66317d 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1061,6 +1061,12 @@ static void __mptcp_clean_una(struct sock *sk)
}
}
+static void __mptcp_clean_una_wakeup(struct sock *sk)
+{
+ __mptcp_clean_una(sk);
+ mptcp_write_space(sk);
+}
+
static void mptcp_enter_memory_pressure(struct sock *sk)
{
struct mptcp_subflow_context *subflow;
@@ -2263,7 +2269,7 @@ static void __mptcp_retrans(struct sock *sk)
struct sock *ssk;
int ret;
- __mptcp_clean_una(sk);
+ __mptcp_clean_una_wakeup(sk);
dfrag = mptcp_rtx_head(sk);
if (!dfrag)
return;
@@ -2983,7 +2989,7 @@ static void mptcp_release_cb(struct sock *sk)
}
if (test_and_clear_bit(MPTCP_CLEAN_UNA, &mptcp_sk(sk)->flags))
- __mptcp_clean_una(sk);
+ __mptcp_clean_una_wakeup(sk);
if (test_and_clear_bit(MPTCP_ERROR_REPORT, &mptcp_sk(sk)->flags))
__mptcp_error_report(sk);
--
2.26.2
1 month, 3 weeks
[PATCH mptcp-net] mptcp: fix missing wakeup
by Paolo Abeni
__mptcp_clean_una() can free write memory and should wake-up
user-space processes when needed.
When such function is invoked by the MPTCP receive path, the wakeup
is not needed, as the TCP stack will later trigger subflow_write_space
which will do the wakeup as needed.
Other __mptcp_clean_una() call sites need an additional wakeup check
Let's bundle the relevant code in a new helper and use it.
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/165
Fixes: 6e628cd3a8f7 ("mptcp: use mptcp release_cb for delayed tasks")
Fixes: 64b9cea7a0af ("mptcp: fix spurious retransmissions")
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
net/mptcp/protocol.c | 10 ++++-
.../testing/selftests/net/mptcp/mptcp_join.sh | 45 ++++++++++++++-----
2 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2859ad2c6990c..87f62fe66317d 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1061,6 +1061,12 @@ static void __mptcp_clean_una(struct sock *sk)
}
}
+static void __mptcp_clean_una_wakeup(struct sock *sk)
+{
+ __mptcp_clean_una(sk);
+ mptcp_write_space(sk);
+}
+
static void mptcp_enter_memory_pressure(struct sock *sk)
{
struct mptcp_subflow_context *subflow;
@@ -2263,7 +2269,7 @@ static void __mptcp_retrans(struct sock *sk)
struct sock *ssk;
int ret;
- __mptcp_clean_una(sk);
+ __mptcp_clean_una_wakeup(sk);
dfrag = mptcp_rtx_head(sk);
if (!dfrag)
return;
@@ -2983,7 +2989,7 @@ static void mptcp_release_cb(struct sock *sk)
}
if (test_and_clear_bit(MPTCP_CLEAN_UNA, &mptcp_sk(sk)->flags))
- __mptcp_clean_una(sk);
+ __mptcp_clean_una_wakeup(sk);
if (test_and_clear_bit(MPTCP_ERROR_REPORT, &mptcp_sk(sk)->flags))
__mptcp_error_report(sk);
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 5d7f940bceac0..28182632fcffb 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -121,12 +121,6 @@ reset_with_add_addr_timeout()
-j DROP
}
-for arg in "$@"; do
- if [ "$arg" = "-c" ]; then
- capture=1
- fi
-done
-
ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool"
@@ -250,6 +244,8 @@ do_transfer()
local_addr="0.0.0.0"
fi
+ local start
+ start=$(date +%s%3N)
ip netns exec ${listener_ns} $mptcp_connect -t $timeout -l -p $port \
-s ${srv_proto} ${local_addr} < "$sin" > "$sout" &
spid=$!
@@ -359,20 +355,43 @@ do_transfer()
wait $spid
rets=$?
+ local stop
+ stop=$(date +%s%3N)
+
if [ $capture -eq 1 ]; then
sleep 1
kill $cappid
fi
+ local duration
+ duration=$((stop-start))
+ printf "(duration %05sms) " "${duration}"
+
+ NSTAT_HISTORY=/tmp/${listener_ns}.nstat ip netns exec ${listener_ns} \
+ nstat | grep Tcp > /tmp/${listener_ns}.out
+ if [ ${listener_ns} != ${connector_ns} ]; then
+ NSTAT_HISTORY=/tmp/${connector_ns}.nstat ip netns exec ${connector_ns} \
+ | grep Tcp > /tmp/${connector_ns}.out
+ fi
if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
echo " client exit code $retc, server $rets" 1>&2
echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
- ip netns exec ${listener_ns} ss -nita 1>&2 -o "sport = :$port"
+ ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
+ cat /tmp/${listener_ns}.out
+
echo -e "\nnetns ${connector_ns} socket stat for ${port}:" 1>&2
- ip netns exec ${connector_ns} ss -nita 1>&2 -o "dport = :$port"
+ ip netns exec ${connector_ns} ss -Menita 1>&2 -o "dport = :$port"
+ [ ${listener_ns} != ${connector_ns} ] && cat /tmp/${connector_ns}.out
cat "$capout"
ret=1
+ check_transfer $sin $cout "file received by client"
+ retc=$?
+ if [ "$test_link_fail" -eq 0 ];then
+ check_transfer $cin $sout "file received by server"
+ else
+ check_transfer $cinsent $sout "file received by server"
+ fi
return 1
fi
@@ -1323,7 +1342,8 @@ usage()
echo " -4 v4mapped_tests"
echo " -b backup_tests"
echo " -p add_addr_ports_tests"
- echo " -c syncookies_tests"
+ echo " -S syncookies_tests"
+ echo " -c capture pcap traces for all tests"
echo " -h help"
}
@@ -1342,7 +1362,7 @@ if [ -z $1 ]; then
exit $ret
fi
-while getopts 'fsltra64bpch' opt; do
+while getopts 'fsltra64bpSch' opt; do
case $opt in
f)
subflows_tests
@@ -1374,9 +1394,12 @@ while getopts 'fsltra64bpch' opt; do
p)
add_addr_ports_tests
;;
- c)
+ S)
syncookies_tests
;;
+ c)
+ capture=1
+ ;;
h | *)
usage
;;
--
2.26.2
1 month, 3 weeks