From bfa757e02f8ec4e27a261ff77dbf70188a907666 Mon Sep 17 00:00:00 2001 From: Eyal Birger Date: Mon, 24 Jun 2019 18:14:57 +0300 Subject: [PATCH 01/13] tc: adjust xtables_match and xtables_target to changes in recent iptables iptables commit 933400b37d09 ("nft: xtables: add the infrastructure to translate from iptables to nft") added an additional member to struct xtables_match and struct xtables_target. This change is available for libxtables12 and up. Add these members conditionally to support both newer and older versions. Fixes: dd29621578d2 ("tc: add em_ipt ematch for calling xtables matches from tc matching context") Signed-off-by: Eyal Birger Signed-off-by: Stephen Hemminger --- include/xtables.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/xtables.h b/include/xtables.h index b48c3166..583619f4 100644 --- a/include/xtables.h +++ b/include/xtables.h @@ -206,6 +206,24 @@ enum xtables_ext_flags { XTABLES_EXT_ALIAS = 1 << 0, }; +#if XTABLES_VERSION_CODE >= 12 +struct xt_xlate; + +struct xt_xlate_mt_params { + const void *ip; + const struct xt_entry_match *match; + int numeric; + bool escape_quotes; +}; + +struct xt_xlate_tg_params { + const void *ip; + const struct xt_entry_target *target; + int numeric; + bool escape_quotes; +}; +#endif + /* Include file for additions: new matches and targets. */ struct xtables_match { @@ -270,6 +288,12 @@ struct xtables_match void (*x6_fcheck)(struct xt_fcheck_call *); const struct xt_option_entry *x6_options; +#if XTABLES_VERSION_CODE >= 12 + /* Translate iptables to nft */ + int (*xlate)(struct xt_xlate *xl, + const struct xt_xlate_mt_params *params); +#endif + /* Size of per-extension instance extra "global" scratch space */ size_t udata_size; @@ -347,6 +371,12 @@ struct xtables_target void (*x6_fcheck)(struct xt_fcheck_call *); const struct xt_option_entry *x6_options; +#if XTABLES_VERSION_CODE >= 12 + /* Translate iptables to nft */ + int (*xlate)(struct xt_xlate *xl, + const struct xt_xlate_tg_params *params); +#endif + size_t udata_size; /* Ignore these men behind the curtain: */ From f7995053724f1ecd5912ed11026a65f90f2a1f58 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 26 Jun 2019 09:18:18 -0700 Subject: [PATCH 02/13] devlink: replace print macros with functions Using functions is safer, and printing is not performance critical. Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 62 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index 559f624e..4e277f7b 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -48,32 +49,53 @@ #define HEALTH_REPORTER_TIMESTAMP_FMT_LEN 80 static int g_new_line_count; - -#define pr_err(args...) fprintf(stderr, ##args) -#define pr_out(args...) \ - do { \ - if (g_indent_newline) { \ - fprintf(stdout, "%s", g_indent_str); \ - g_indent_newline = false; \ - } \ - fprintf(stdout, ##args); \ - g_new_line_count = 0; \ - } while (0) - -#define pr_out_sp(num, args...) \ - do { \ - int ret = fprintf(stdout, ##args); \ - if (ret < num) \ - fprintf(stdout, "%*s", num - ret, ""); \ - g_new_line_count = 0; \ - } while (0) - static int g_indent_level; static bool g_indent_newline; + #define INDENT_STR_STEP 2 #define INDENT_STR_MAXLEN 32 static char g_indent_str[INDENT_STR_MAXLEN + 1] = ""; +static void __attribute__((format(printf, 1, 2))) +pr_err(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); +} + +static void __attribute__((format(printf, 1, 2))) +pr_out(const char *fmt, ...) +{ + va_list ap; + + if (g_indent_newline) { + printf("%s", g_indent_str); + g_indent_newline = false; + } + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + g_new_line_count = 0; +} + +static void __attribute__((format(printf, 2, 3))) +pr_out_sp(unsigned int num, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = vprintf(fmt, ap); + va_end(ap); + + if (ret < num) + printf("%*s", num - ret, ""); + g_new_line_count = 0; \ +} + static void __pr_out_indent_inc(void) { if (g_indent_level + INDENT_STR_STEP > INDENT_STR_MAXLEN) From 5a403866f3691e1c2a1b7c7b677e9a7feeec0aa2 Mon Sep 17 00:00:00 2001 From: Hangbin Liu Date: Wed, 26 Jun 2019 09:44:07 +0800 Subject: [PATCH 03/13] ip/iptoken: fix dump error when ipv6 disabled When we disable IPv6 from the start up (ipv6.disable=1), there will be no IPv6 route info in the dump message. If we return -1 when ifi->ifi_family != AF_INET6, we will get error like $ ip token list Dump terminated which will make user feel confused. There is no need to return -1 if the dump message not match. Return 0 is enough. Signed-off-by: Hangbin Liu Signed-off-by: Stephen Hemminger --- ip/iptoken.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip/iptoken.c b/ip/iptoken.c index f1194c3e..9f356890 100644 --- a/ip/iptoken.c +++ b/ip/iptoken.c @@ -60,9 +60,9 @@ static int print_token(struct nlmsghdr *n, void *arg) return -1; if (ifi->ifi_family != AF_INET6) - return -1; + return 0; if (ifi->ifi_index == 0) - return -1; + return 0; if (ifindex > 0 && ifi->ifi_index != ifindex) return 0; if (ifi->ifi_flags & (IFF_LOOPBACK | IFF_NOARP)) From b5cf263670dc13a8f56cbe3a45fef08a0420a494 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 25 Jun 2019 13:41:24 +0200 Subject: [PATCH 04/13] iproute: Set flags and attributes on dump to get IPv6 cached routes to be flushed With a current (5.1) kernel version, IPv6 exception routes can't be listed (ip -6 route list cache) or flushed (ip -6 route flush cache). Kernel support for this is being added back. Relevant net-next commits: 564c91f7e563 fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED ef11209d4219 Revert "net/ipv6: Bail early if user only wants cloned entries" 3401bfb1638e ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del() bf9a8a061ddc ipv6/route: Change return code of rt6_dump_route() for partial node dumps 1e47b4837f3b ipv6: Dump route exceptions if requested 40cb35d5dc04 ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1() However, to allow the kernel to filter routes based on the RTM_F_CLONED flag, we need to make sure this flag is always passed when we want cached routes to be dumped, and we can also pass table and output interface attributes to have the kernel filtering on them, if requested by the user. Use the existing iproute_dump_filter() as a filter for the dump request in iproute_flush(). This way, 'ip -6 route flush cache' works again. v2: Instead of creating a separate 'filter' function dealing with RTM_F_CACHED only, use the existing iproute_dump_filter() and get table and oif kernel filtering for free. Suggested by David Ahern. Fixes: aba5acdfdb34 ("(Logical change 1.3)") Signed-off-by: Stefano Brivio Signed-off-by: Stephen Hemminger --- ip/iproute.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/ip/iproute.c b/ip/iproute.c index 2b3dcc5d..1669e013 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -1602,6 +1602,30 @@ static int save_route_prep(void) return 0; } +static int iproute_dump_filter(struct nlmsghdr *nlh, int reqlen) +{ + struct rtmsg *rtm = NLMSG_DATA(nlh); + int err; + + rtm->rtm_protocol = filter.protocol; + if (filter.cloned) + rtm->rtm_flags |= RTM_F_CLONED; + + if (filter.tb) { + err = addattr32(nlh, reqlen, RTA_TABLE, filter.tb); + if (err) + return err; + } + + if (filter.oif) { + err = addattr32(nlh, reqlen, RTA_OIF, filter.oif); + if (err) + return err; + } + + return 0; +} + static int iproute_flush(int family, rtnl_filter_t filter_fn) { time_t start = time(0); @@ -1624,7 +1648,7 @@ static int iproute_flush(int family, rtnl_filter_t filter_fn) filter.flushe = sizeof(flushb); for (;;) { - if (rtnl_routedump_req(&rth, family, NULL) < 0) { + if (rtnl_routedump_req(&rth, family, iproute_dump_filter) < 0) { perror("Cannot send dump request"); return -2; } @@ -1664,30 +1688,6 @@ static int iproute_flush(int family, rtnl_filter_t filter_fn) } } -static int iproute_dump_filter(struct nlmsghdr *nlh, int reqlen) -{ - struct rtmsg *rtm = NLMSG_DATA(nlh); - int err; - - rtm->rtm_protocol = filter.protocol; - if (filter.cloned) - rtm->rtm_flags |= RTM_F_CLONED; - - if (filter.tb) { - err = addattr32(nlh, reqlen, RTA_TABLE, filter.tb); - if (err) - return err; - } - - if (filter.oif) { - err = addattr32(nlh, reqlen, RTA_OIF, filter.oif); - if (err) - return err; - } - - return 0; -} - static int iproute_list_flush_or_save(int argc, char **argv, int action) { int dump_family = preferred_family; From 8ae99cc46d7713069ee626a4ce4335aaeca9892f Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Tue, 25 Jun 2019 12:29:55 +0200 Subject: [PATCH 05/13] ip address: do not set nodad option for IPv4 addresses Duplicate Address Detection (RFC 4862) is available only for IPv6 addresses. As a consequence, 'nodad' option, turning it off, should be available only for IPv6, and is defined like that in the man page. However it is possible to set nodad on IPv4 addresses, too: $ ip link add dummy0 type dummy $ ip -4 addr add 192.168.1.1 dev dummy0 nodad $ ip a 1: dummy0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 1a:6d:c6:96:ca:f8 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/32 scope global nodad dummy0 valid_lft forever preferred_lft forever Fix this adding a check on the protocol family before setting IFA_F_NODAD flag. Fixes: bac735c53a36d ("enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- ip/ipaddress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index fd79f978..1b8ab783 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -2249,7 +2249,10 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) } else if (strcmp(*argv, "home") == 0) { ifa_flags |= IFA_F_HOMEADDRESS; } else if (strcmp(*argv, "nodad") == 0) { - ifa_flags |= IFA_F_NODAD; + if (req.ifa.ifa_family == AF_INET6) + ifa_flags |= IFA_F_NODAD; + else + fprintf(stderr, "Warning: nodad option can be set only for IPv6 addresses\n"); } else if (strcmp(*argv, "mngtmpaddr") == 0) { ifa_flags |= IFA_F_MANAGETEMPADDR; } else if (strcmp(*argv, "noprefixroute") == 0) { From e4448b6c7de934f26654d4db84119c0423923719 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Tue, 25 Jun 2019 12:29:56 +0200 Subject: [PATCH 06/13] ip address: do not set home option for IPv4 addresses 'home' option designates a IPv6 address as "home address" as defined in RFC 6275. This option should be available only for IPv6 addresses, as correctly stated in the manpage. However it is possible to set home on IPv4 addresses, too: $ ip link add dummy0 type dummy $ ip -4 addr add 192.168.1.1 dev dummy0 home $ ip a 1: dummy0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 1a:6d:c6:96:ca:f8 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/32 scope global home dummy0 valid_lft forever preferred_lft forever Fix this adding a check on the protocol family before setting IFA_F_HOMEADDRESS flag. Fixes: bac735c53a36d ("enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- ip/ipaddress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 1b8ab783..7acbd32e 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -2247,7 +2247,10 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) if (set_lifetime(&preferred_lft, *argv)) invarg("preferred_lft value", *argv); } else if (strcmp(*argv, "home") == 0) { - ifa_flags |= IFA_F_HOMEADDRESS; + if (req.ifa.ifa_family == AF_INET6) + ifa_flags |= IFA_F_HOMEADDRESS; + else + fprintf(stderr, "Warning: home option can be set only for IPv6 addresses\n"); } else if (strcmp(*argv, "nodad") == 0) { if (req.ifa.ifa_family == AF_INET6) ifa_flags |= IFA_F_NODAD; From 68c46872ce4394376c8b5e804be4f5a2bbd43828 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Tue, 25 Jun 2019 12:29:57 +0200 Subject: [PATCH 07/13] ip address: do not set mngtmpaddr option for IPv4 addresses 'mngtmpaddr' option make the kernel manage temporary addresses created from the specified one as template on behalf of Privacy Extensions (RFC3041). This option should be available only for IPv6 addresses, as correctly stated in the manpage. However it is possible to set mngtmpaddr on IPv4 addresses, too: $ ip link add dummy0 type dummy $ ip -4 addr add 192.168.1.1 dev dummy0 mngtmpaddr $ ip a 1: dummy0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 1a:6d:c6:96:ca:f8 brd ff:ff:ff:ff:ff:ff inet 192.168.1.1/32 scope global mngtmpaddr dummy0 valid_lft forever preferred_lft forever Fix this adding a check on the protocol family before setting IFA_F_MANAGETEMPADDR flag. Fixes: 5b7e21c417bea ("add support for IFA_F_MANAGETEMPADDR") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- ip/ipaddress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 7acbd32e..733f7d9d 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -2257,7 +2257,10 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv) else fprintf(stderr, "Warning: nodad option can be set only for IPv6 addresses\n"); } else if (strcmp(*argv, "mngtmpaddr") == 0) { - ifa_flags |= IFA_F_MANAGETEMPADDR; + if (req.ifa.ifa_family == AF_INET6) + ifa_flags |= IFA_F_MANAGETEMPADDR; + else + fprintf(stderr, "Warning: mngtmpaddr option can be set only for IPv6 addresses\n"); } else if (strcmp(*argv, "noprefixroute") == 0) { ifa_flags |= IFA_F_NOPREFIXROUTE; } else if (strcmp(*argv, "autojoin") == 0) { From ee09370a7206ad361653e437ca6429533a1c02a9 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Thu, 27 Jun 2019 21:37:18 +0300 Subject: [PATCH 08/13] devlink: fix format string warning for 32bit targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 32bit targets define uint64_t as long long unsigned. This leads to the following build warning: devlink.c: In function ‘pr_out_u64’: devlink.c:1729:11: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=] pr_out("%s %lu", name, val); ^ devlink.c:59:21: note: in definition of macro ‘pr_out’ fprintf(stdout, ##args); \ ^~~~ Use uint64_t specific conversion specifiers in the format string to fix that. Cc: Aya Levin Cc: Moshe Shemesh Signed-off-by: Baruch Siach Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index 4e277f7b..97b93730 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -1748,9 +1748,9 @@ static void pr_out_u64(struct dl *dl, const char *name, uint64_t val) jsonw_u64_field(dl->jw, name, val); } else { if (g_indent_newline) - pr_out("%s %lu", name, val); + pr_out("%s %"PRIu64, name, val); else - pr_out(" %s %lu", name, val); + pr_out(" %s %"PRIu64, name, val); } } @@ -1775,7 +1775,7 @@ static void pr_out_uint64_value(struct dl *dl, uint64_t value) if (dl->json_output) jsonw_u64(dl->jw, value); else - pr_out(" %lu", value); + pr_out(" %"PRIu64, value); } static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len) From d0272f5404773a60cbc17c2277affdbbf8d99c67 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Thu, 27 Jun 2019 21:37:19 +0300 Subject: [PATCH 09/13] devlink: fix libc and kernel headers collision Since commit 2f1242efe9d ("devlink: Add devlink health show command") we use the sys/sysinfo.h header for the sysinfo(2) system call. But since iproute2 carries a local version of the kernel struct sysinfo, this causes a collision with libc that do not rely on kernel defined sysinfo like musl libc: In file included from devlink.c:25:0: .../sysroot/usr/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo' struct sysinfo { ^~~~~~~ In file included from ../include/uapi/linux/kernel.h:5:0, from ../include/uapi/linux/netlink.h:5, from ../include/uapi/linux/genetlink.h:6, from devlink.c:21: ../include/uapi/linux/sysinfo.h:8:8: note: originally defined here struct sysinfo { ^~~~~~~ Move the sys/sysinfo.h userspace header before kernel headers, and suppress the indirect include of linux/sysinfo.h. Cc: Aya Levin Cc: Moshe Shemesh Signed-off-by: Baruch Siach Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index 97b93730..5618ba26 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -19,11 +19,12 @@ #include #include #include +#include +#define _LINUX_SYSINFO_H /* avoid collision with musl header */ #include #include #include #include -#include #include #include "SNAPSHOT.h" From c95e17dcba73e6b45fcdcdb88fc35bf49b298760 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Mon, 1 Jul 2019 16:04:41 +0200 Subject: [PATCH 10/13] man: tc-netem.8: fix URL for netem page URL for netem page on sources section points to a no more existent resource. Fix this using the correct URL. Fixes: cd72dcf13c8a4 ("netem: add man-page") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- man/man8/tc-netem.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/tc-netem.8 b/man/man8/tc-netem.8 index 111109cf..5a08a406 100644 --- a/man/man8/tc-netem.8 +++ b/man/man8/tc-netem.8 @@ -219,7 +219,7 @@ April 2005 (http://devresources.linux-foundation.org/shemminger/netem/LCA2005_paper.pdf) .IP " 2. " 4 -Netem page from Linux foundation, (http://www.linuxfoundation.org/en/Net:Netem) +Netem page from Linux foundation, (https://wiki.linuxfoundation.org/networking/netem) .IP " 3. " 4 Salsano S., Ludovici F., Ordine A., "Definition of a general and intuitive loss From d791e75d74ffe212563c271f9ffa8a2e371770d5 Mon Sep 17 00:00:00 2001 From: Tomasz Torcz Date: Tue, 2 Jul 2019 08:53:39 +0200 Subject: [PATCH 11/13] ss: in --numeric mode, print raw numbers for data rates ss by default shows data rates in human-readable form - as Mbps/Gbps etc. Enhance --numeric mode to show raw values in bps, without conversion. Signed-of-by: Tomasz Torcz Signed-off-by: Stephen Hemminger --- man/man8/ss.8 | 2 +- misc/ss.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/man/man8/ss.8 b/man/man8/ss.8 index 9054fab9..f428e60c 100644 --- a/man/man8/ss.8 +++ b/man/man8/ss.8 @@ -28,7 +28,7 @@ Suppress header line. Print each socket's data on a single line. .TP .B \-n, \-\-numeric -Do not try to resolve service names. +Do not try to resolve service names. Show exact bandwidth values, instead of human-readable. .TP .B \-r, \-\-resolve Try to resolve numeric address/ports. diff --git a/misc/ss.c b/misc/ss.c index 99c06d31..3d9d1d8f 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2361,7 +2361,9 @@ static int proc_inet_split_line(char *line, char **loc, char **rem, char **data) static char *sprint_bw(char *buf, double bw) { - if (bw > 1000000.) + if (!resolve_services) + sprintf(buf, "%.0f", bw); + else if (bw > 1000000.) sprintf(buf, "%.1fM", bw / 1000000.); else if (bw > 1000.) sprintf(buf, "%.1fK", bw / 1000.); From 90f0b587d8f77281e88f122855abe42e30c4a4f8 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Thu, 27 Jun 2019 16:47:45 +0200 Subject: [PATCH 12/13] tc: netem: fix r parameter in Bernoulli loss model As the man page for tc netem states: To use the Bernoulli model, the only needed parameter is p while the others will be set to the default values r=1-p, 1-h=1 and 1-k=0. However r parameter is erroneusly set to 1, and not to 1-p. Fix this using the same approach of the 4-state loss model. Fixes: 3c7950af598be ("netem: add support for 4 state and GE loss model") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- tc/q_netem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tc/q_netem.c b/tc/q_netem.c index 6e0e8a8c..d1cd17f8 100644 --- a/tc/q_netem.c +++ b/tc/q_netem.c @@ -284,14 +284,17 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, } } else if (!strcmp(*argv, "gemodel")) { + double p; + NEXT_ARG(); - if (get_percent(&gemodel.p, *argv)) { + if (parse_percent(&p, *argv)) { explain1("loss gemodel p"); return -1; } + set_percent(&gemodel.p, p); /* set defaults */ - set_percent(&gemodel.r, 1.); + set_percent(&gemodel.r, 1. - p); set_percent(&gemodel.h, 0); set_percent(&gemodel.k1, 0); loss_type = NETEM_LOSS_GE; From af2583437ea03f7d74815bee7c1c7b03baaf4894 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 8 Jul 2019 11:09:59 -0700 Subject: [PATCH 13/13] v5.2.0 --- include/SNAPSHOT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SNAPSHOT.h b/include/SNAPSHOT.h index b9ed53fd..0a083450 100644 --- a/include/SNAPSHOT.h +++ b/include/SNAPSHOT.h @@ -1 +1 @@ -static const char SNAPSHOT[] = "190510"; +static const char SNAPSHOT[] = "190708";