From 45a0dc164a8105701c24043a847050efd647a3cb Mon Sep 17 00:00:00 2001 From: Hangbin Liu Date: Mon, 5 Sep 2016 11:35:02 +0800 Subject: [PATCH 1/4] nstat: add sctp snmp support SCTP module was not load by default. But this should be OK since we will not load table if fdopen() failed, also opening the proc file won't load SCTP kernel module. Signed-off-by: Hangbin Liu --- misc/nstat.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/misc/nstat.c b/misc/nstat.c index 6143719e..1cb6c7ee 100644 --- a/misc/nstat.c +++ b/misc/nstat.c @@ -76,6 +76,11 @@ static int net_snmp6_open(void) return generic_proc_open("PROC_NET_SNMP6", "net/snmp6"); } +static int net_sctp_snmp_open(void) +{ + return generic_proc_open("PROC_NET_SCTP_SNMP", "net/sctp/snmp"); +} + struct nstat_ent { struct nstat_ent *next; char *id; @@ -247,6 +252,16 @@ static void load_ugly_table(FILE *fp) } } +static void load_sctp_snmp(void) +{ + FILE *fp = fdopen(net_sctp_snmp_open(), "r"); + + if (fp) { + load_good_table(fp); + fclose(fp); + } +} + static void load_snmp(void) { FILE *fp = fdopen(net_snmp_open(), "r"); @@ -391,6 +406,7 @@ static void update_db(int interval) load_netstat(); load_snmp6(); load_snmp(); + load_sctp_snmp(); h = kern_db; kern_db = n; @@ -450,6 +466,7 @@ static void server_loop(int fd) load_netstat(); load_snmp6(); load_snmp(); + load_sctp_snmp(); for (;;) { int status; @@ -706,6 +723,7 @@ int main(int argc, char *argv[]) load_netstat(); load_snmp6(); load_snmp(); + load_sctp_snmp(); if (info_source[0] == 0) strcpy(info_source, "kernel"); } From 12f92e2e4f027ba509275464e5b14ab0522cb258 Mon Sep 17 00:00:00 2001 From: Hangbin Liu Date: Tue, 6 Sep 2016 14:42:52 +0800 Subject: [PATCH 2/4] gitignore: Ignore 'tags' file generated by ctags Signed-off-by: Hangbin Liu --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ef03b174..74a5496d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ Config # cscope cscope.* ncscope.* +tags TAGS # git files that we don't want to ignore even it they are dot-files From 113fab78e48c14c0d2a57ae8ada95a5921f70538 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Thu, 8 Sep 2016 14:56:34 +0200 Subject: [PATCH 3/4] tuntap: Add name attribute to usage text Signed-off-by: Thomas Graf --- ip/iptuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iptuntap.c b/ip/iptuntap.c index 34fb0cf3..451f7f0e 100644 --- a/ip/iptuntap.c +++ b/ip/iptuntap.c @@ -39,7 +39,7 @@ static void usage(void) { fprintf(stderr, "Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n"); fprintf(stderr, " [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n"); - fprintf(stderr, " [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ]\n"); + fprintf(stderr, " [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n"); fprintf(stderr, "\n"); fprintf(stderr, "Where: USER := { STRING | NUMBER }\n"); fprintf(stderr, " GROUP := { STRING | NUMBER }\n"); From 31a29009c5e921e81ff8419c482f826de5a1a493 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 8 Sep 2016 12:33:03 +0200 Subject: [PATCH 4/4] iproute: fix documentation for ip rule scan order Hi, On Thu, Sep 08, 2016 at 11:59:55AM +0200, Michal Kubecek wrote: > On Thu, Sep 01, 2016 at 09:04:54AM -0700, Stephen Hemminger wrote: > > On Tue, 30 Aug 2016 17:32:52 -0700 > > Iskren Chernev wrote: > > > > > From 416f45b62f33017d19a9b14e7b0179807c993cbe Mon Sep 17 00:00:00 2001 > > > From: Iskren Chernev > > > Date: Tue, 30 Aug 2016 17:08:54 -0700 > > > Subject: [PATCH bug-fix] iproute: fix documentation for ip rule scan order > > > > > > --- > > > man/man8/ip-rule.8 | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/man/man8/ip-rule.8 b/man/man8/ip-rule.8 > > > index 1774ae3..3508d80 100644 > > > --- a/man/man8/ip-rule.8 > > > +++ b/man/man8/ip-rule.8 > > > @@ -93,7 +93,7 @@ Each policy routing rule consists of a > > > .B selector > > > and an > > > .B action predicate. > > > -The RPDB is scanned in order of decreasing priority. The selector > > > +The RPDB is scanned in order of increasing priority. The selector > > > of each rule is applied to {source address, destination address, > > > incoming > > > interface, tos, fwmark} and, if the selector matches the packet, > > > the action is performed. The action predicate may return with success. > > > -- > > > 2.4.5 > > > > Applied > > I'm sorry I didn't notice before but this just reverts the change done > by commit 49572501664d ("iproute2: clarification of various man8 pages"). > IMHO the problem is that both versions are equally confusing as the word > "priority" can be understood in two different senses. > > How about more explicit formulation, e.g. > > ... in order of decreasing logical priority (i.e. increasing numeric > values). > > Would that be better? Looks like the real issue is missing definition of priority. What about this: --- man/man8/ip-rule.8 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/man/man8/ip-rule.8 b/man/man8/ip-rule.8 index 3508d809..13fe9f7f 100644 --- a/man/man8/ip-rule.8 +++ b/man/man8/ip-rule.8 @@ -93,7 +93,7 @@ Each policy routing rule consists of a .B selector and an .B action predicate. -The RPDB is scanned in order of increasing priority. The selector +The RPDB is scanned in order of decreasing priority. The selector of each rule is applied to {source address, destination address, incoming interface, tos, fwmark} and, if the selector matches the packet, the action is performed. The action predicate may return with success. @@ -221,8 +221,10 @@ value to match. .TP .BI priority " PREFERENCE" -the priority of this rule. Each rule should have an explicitly -set +the priority of this rule. +.I PREFERENCE +is an unsigned integer value, higher number means lower priority. Each rule +should have an explicitly set .I unique priority value. The options preference and order are synonyms with priority.