From 6bf156415a588fa1c975be9a18a1579f63a936a2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 29 Nov 2017 18:34:09 +0100 Subject: [PATCH 1/4] man: tc-csum.8: Fix inconsistency in example description Commit 6bbe5e6290db5 ("man: tc-csum.8: Fix example") changed both source and destination IP addresses in example code but missed to update the example's description accordingly. Fixes: 6bbe5e6290db5 ("man: tc-csum.8: Fix example") Signed-off-by: Phil Sutter --- man/man8/tc-csum.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/man8/tc-csum.8 b/man/man8/tc-csum.8 index 409ab717..65724b88 100644 --- a/man/man8/tc-csum.8 +++ b/man/man8/tc-csum.8 @@ -53,8 +53,8 @@ SCTP header .B SWEETS These are merely syntactic sugar and ignored internally. .SH EXAMPLES -The following performs stateless NAT for incoming packets from 192.168.1.100 to -new destination 18.52.86.120 (0x12345678 in hex). Assuming these are UDP +The following performs stateless NAT for incoming packets from 192.0.2.100 to +new destination 198.51.100.1. Assuming these are UDP packets, both IP and UDP checksums have to be recalculated: .RS From 39be47fb5ed756b951ee7325b11099eb117fd5fd Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 5 Dec 2017 17:30:22 -0800 Subject: [PATCH 2/4] update headers from 4.15-rc2 Signed-off-by: Stephen Hemminger --- include/uapi/linux/vm_sockets_diag.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/vm_sockets_diag.h b/include/uapi/linux/vm_sockets_diag.h index a732a6f5..6da42f99 100644 --- a/include/uapi/linux/vm_sockets_diag.h +++ b/include/uapi/linux/vm_sockets_diag.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* AF_VSOCK sock_diag(7) interface for querying open sockets */ #ifndef __VM_SOCKETS_DIAG_H__ From 00ac78d39c29f74df636346722664fd762a6b0f8 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Thu, 7 Dec 2017 16:12:00 -0800 Subject: [PATCH 3/4] ss: print tcpi_rcv_ssthresh tcpi_rcv_ssthresh is an important stats when debugging receive side behavior. Add it to the ss output. Signed-off-by: Wei Wang Signed-off-by: Eric Dumazet --- misc/ss.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/ss.c b/misc/ss.c index b5099d1e..90da93e3 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -751,6 +751,7 @@ struct tcpstat { double rcv_rtt; double min_rtt; int rcv_space; + unsigned int rcv_ssthresh; unsigned long long busy_time; unsigned long long rwnd_limited; unsigned long long sndbuf_limited; @@ -2058,6 +2059,8 @@ static void tcp_stats_print(struct tcpstat *s) printf(" rcv_rtt:%g", s->rcv_rtt); if (s->rcv_space) printf(" rcv_space:%d", s->rcv_space); + if (s->rcv_ssthresh) + printf(" rcv_ssthresh:%u", s->rcv_ssthresh); if (s->not_sent) printf(" notsent:%u", s->not_sent); if (s->min_rtt) @@ -2304,6 +2307,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, s.fackets = info->tcpi_fackets; s.reordering = info->tcpi_reordering; s.rcv_space = info->tcpi_rcv_space; + s.rcv_ssthresh = info->tcpi_rcv_ssthresh; s.cwnd = info->tcpi_snd_cwnd; if (info->tcpi_snd_ssthresh < 0xFFFF) From 3572e01a090a298e2f4c4f796bad6639b652e031 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 8 Dec 2017 11:18:07 +0100 Subject: [PATCH 4/4] tc: util: Don't call NEXT_ARG_FWD() in __parse_action_control() Not all callers want parse_action_control*() to advance the arguments. For instance act_parse_police() does the argument advancing itself. Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions") Signed-off-by: Michal Privoznik --- tc/m_bpf.c | 1 + tc/m_connmark.c | 1 + tc/m_csum.c | 1 + tc/m_gact.c | 10 +++++----- tc/m_ife.c | 1 + tc/m_mirred.c | 4 +++- tc/m_nat.c | 1 + tc/m_pedit.c | 1 + tc/m_sample.c | 1 + tc/m_skbedit.c | 1 + tc/m_skbmod.c | 1 + tc/m_tunnel_key.c | 1 + tc/m_vlan.c | 1 + tc/tc_util.c | 1 - 14 files changed, 19 insertions(+), 7 deletions(-) diff --git a/tc/m_bpf.c b/tc/m_bpf.c index 1c1f71cd..576f69cc 100644 --- a/tc/m_bpf.c +++ b/tc/m_bpf.c @@ -129,6 +129,7 @@ opt_bpf: parse_action_control_dflt(&argc, &argv, &parm.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { diff --git a/tc/m_connmark.c b/tc/m_connmark.c index 37d71854..47c7a8c2 100644 --- a/tc/m_connmark.c +++ b/tc/m_connmark.c @@ -82,6 +82,7 @@ parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, } parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { diff --git a/tc/m_csum.c b/tc/m_csum.c index 7b156734..e1352c08 100644 --- a/tc/m_csum.c +++ b/tc/m_csum.c @@ -124,6 +124,7 @@ parse_csum(struct action_util *a, int *argc_p, } parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_OK); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { diff --git a/tc/m_gact.c b/tc/m_gact.c index e7d91dab..b30b0420 100644 --- a/tc/m_gact.c +++ b/tc/m_gact.c @@ -87,14 +87,13 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, if (argc < 0) return -1; - - if (matches(*argv, "gact") == 0) { - argc--; - argv++; - } else if (parse_action_control(&argc, &argv, &p.action, false) == -1) { + if (matches(*argv, "gact") != 0 && + parse_action_control(&argc, &argv, &p.action, false) == -1) { usage(); /* does not return */ } + NEXT_ARG_FWD(); + #ifdef CONFIG_GACT_PROB if (argc > 0) { if (matches(*argv, "random") == 0) { @@ -114,6 +113,7 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, if (parse_action_control(&argc, &argv, &pp.paction, false) == -1) usage(); + NEXT_ARG_FWD(); if (get_u16(&pp.pval, *argv, 10)) { fprintf(stderr, "Illegal probability val 0x%x\n", diff --git a/tc/m_ife.c b/tc/m_ife.c index 205efc9f..4647f6a6 100644 --- a/tc/m_ife.c +++ b/tc/m_ife.c @@ -159,6 +159,7 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p, parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_mirred.c b/tc/m_mirred.c index 3870d3a4..aa7ce6d9 100644 --- a/tc/m_mirred.c +++ b/tc/m_mirred.c @@ -202,8 +202,10 @@ parse_direction(struct action_util *a, int *argc_p, char ***argv_p, } - if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR) + if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR) { parse_action_control(&argc, &argv, &p.action, false); + NEXT_ARG_FWD(); + } if (argc) { if (iok && matches(*argv, "index") == 0) { diff --git a/tc/m_nat.c b/tc/m_nat.c index 1e4ff51f..f5de4d4c 100644 --- a/tc/m_nat.c +++ b/tc/m_nat.c @@ -116,6 +116,7 @@ parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_OK); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_pedit.c b/tc/m_pedit.c index 26549eee..dc57f14a 100644 --- a/tc/m_pedit.c +++ b/tc/m_pedit.c @@ -672,6 +672,7 @@ int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, parse_action_control_dflt(&argc, &argv, &sel.sel.action, false, TC_ACT_OK); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_sample.c b/tc/m_sample.c index ff5ee6bd..31774c0e 100644 --- a/tc/m_sample.c +++ b/tc/m_sample.c @@ -100,6 +100,7 @@ static int parse_sample(struct action_util *a, int *argc_p, char ***argv_p, parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c index aa374fcb..c41a7bb0 100644 --- a/tc/m_skbedit.c +++ b/tc/m_skbedit.c @@ -123,6 +123,7 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_skbmod.c b/tc/m_skbmod.c index 561b73fb..bc268dfd 100644 --- a/tc/m_skbmod.c +++ b/tc/m_skbmod.c @@ -124,6 +124,7 @@ static int parse_skbmod(struct action_util *a, int *argc_p, char ***argv_p, parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c index 1cdd0356..2dc91879 100644 --- a/tc/m_tunnel_key.c +++ b/tc/m_tunnel_key.c @@ -175,6 +175,7 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p, parse_action_control_dflt(&argc, &argv, &parm.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/m_vlan.c b/tc/m_vlan.c index 161759fd..edae0d1e 100644 --- a/tc/m_vlan.c +++ b/tc/m_vlan.c @@ -131,6 +131,7 @@ static int parse_vlan(struct action_util *a, int *argc_p, char ***argv_p, parse_action_control_dflt(&argc, &argv, &parm.action, false, TC_ACT_PIPE); + NEXT_ARG_FWD(); if (argc) { if (matches(*argv, "index") == 0) { NEXT_ARG(); diff --git a/tc/tc_util.c b/tc/tc_util.c index 18879056..ee9a70aa 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -586,7 +586,6 @@ static int __parse_action_control(int *argc_p, char ***argv_p, int *result_p, } result |= jump_cnt; } - NEXT_ARG_FWD(); *argc_p = argc; *argv_p = argv; *result_p = result;