diff --git a/Makefile b/Makefile index a513cf38..48f469b0 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,12 @@ distclean: clobber check: all cd testsuite && $(MAKE) && $(MAKE) alltests + @if command -v man >/dev/null 2>&1; then \ + echo "Checking manpages for syntax errors..."; \ + $(MAKE) -C man check; \ + else \ + echo "man not installed, skipping checks for syntax errors."; \ + fi cscope: cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h index 92242d20..1d30d797 100644 --- a/include/uapi/linux/in.h +++ b/include/uapi/linux/in.h @@ -268,7 +268,7 @@ struct sockaddr_in { #define IN_MULTICAST(a) IN_CLASSD(a) #define IN_MULTICAST_NET 0xe0000000 -#define IN_BADCLASS(a) ((((long int) (a) ) == 0xffffffff) +#define IN_BADCLASS(a) (((long int) (a) ) == (long int)0xffffffff) #define IN_EXPERIMENTAL(a) IN_BADCLASS((a)) #define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000) diff --git a/ip/iproute.c b/ip/iproute.c index 0440366e..5f58a3b3 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -2068,7 +2068,9 @@ static int iproute_get(int argc, char **argv) if (req.r.rtm_family == AF_UNSPEC) req.r.rtm_family = AF_INET; - req.r.rtm_flags |= RTM_F_LOOKUP_TABLE; + /* Only IPv4 supports the RTM_F_LOOKUP_TABLE flag */ + if (req.r.rtm_family == AF_INET) + req.r.rtm_flags |= RTM_F_LOOKUP_TABLE; if (fib_match) req.r.rtm_flags |= RTM_F_FIB_MATCH; diff --git a/man/Makefile b/man/Makefile index 6b095ee4..0c759dd2 100644 --- a/man/Makefile +++ b/man/Makefile @@ -2,14 +2,19 @@ INSTALL=install INSTALLDIR=install -m 0755 -d INSTALLMAN=install -m 0644 +# Pass the same parameters as Lintian uses on Debian. +MAN_CHECK=LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings \ + --encoding=UTF-8 --local-file --troff-device=utf8 --ditroff +# Hide man output, count and print errors. +MAN_REDIRECT=2>&1 >/dev/null | tee /dev/fd/2 | wc -l SUBDIRS = man3 man7 man8 -all clean install: +all clean install check: @for subdir in $(SUBDIRS); do $(MAKE) -C $$subdir $@ || exit $$?; done distclean: clean -.PHONY: install clean distclean +.PHONY: install clean distclean check .EXPORT_ALL_VARIABLES: diff --git a/man/man3/Makefile b/man/man3/Makefile index e3d3e607..1732be26 100644 --- a/man/man3/Makefile +++ b/man/man3/Makefile @@ -11,4 +11,8 @@ install: $(INSTALLDIR) $(DESTDIR)$(MANDIR)/man3 $(INSTALLMAN) $(MAN3PAGES) $(DESTDIR)$(MANDIR)/man3 -.PHONY: install clean distclean +check: + @for page in $(MAN3PAGES); do test 0 -eq $$($(MAN_CHECK) $$page \ + $(MAN_REDIRECT)) || { echo "Error in $$page"; exit 1; }; done + +.PHONY: install clean distclean check diff --git a/man/man7/Makefile b/man/man7/Makefile index 1a8d5219..c0e545a1 100644 --- a/man/man7/Makefile +++ b/man/man7/Makefile @@ -11,4 +11,8 @@ install: $(INSTALLDIR) $(DESTDIR)$(MANDIR)/man7 $(INSTALLMAN) $(MAN7PAGES) $(DESTDIR)$(MANDIR)/man7 -.PHONY: install clean distclean +check: + @for page in $(MAN7PAGES); do test 0 -eq $$($(MAN_CHECK) $$page \ + $(MAN_REDIRECT)) || { echo "Error in $$page"; exit 1; }; done + +.PHONY: install clean distclean check diff --git a/man/man8/Makefile b/man/man8/Makefile index 932ba1f3..0269e174 100644 --- a/man/man8/Makefile +++ b/man/man8/Makefile @@ -23,4 +23,8 @@ install: $(INSTALLDIR) $(DESTDIR)$(MANDIR)/man8 $(INSTALLMAN) $(MAN8PAGES) $(DESTDIR)$(MANDIR)/man8 -.PHONY: install clean distclean +check: all + @for page in $(MAN8PAGES); do test 0 -eq $$($(MAN_CHECK) $$page \ + $(MAN_REDIRECT)) || { echo "Error in $$page"; exit 1; }; done + +.PHONY: install clean distclean check diff --git a/man/man8/ss.8 b/man/man8/ss.8 index f138c91a..553a6cf4 100644 --- a/man/man8/ss.8 +++ b/man/man8/ss.8 @@ -89,11 +89,17 @@ an uuid of the socket Show socket memory usage. The output format is: .RS .P -skmem:(r,rb,t,tb,f, +skmem:(r,rb,t,tb, .br .RS .RS -w,o,bl) +f,w, +.RE +.RE +.br +.RS +.RS +o,bl) .RE .RE .P diff --git a/man/man8/tc-taprio.8 b/man/man8/tc-taprio.8 index 92055b43..850be9b0 100644 --- a/man/man8/tc-taprio.8 +++ b/man/man8/tc-taprio.8 @@ -45,7 +45,7 @@ How traffic is mapped to different hardware queues is similar to and so the .B map and -.Q queues +.B queues parameters have the same meaning. The other parameters specify the schedule, and at what point in time diff --git a/man/man8/tc-tunnel_key.8 b/man/man8/tc-tunnel_key.8 index dc8421b4..2145eb62 100644 --- a/man/man8/tc-tunnel_key.8 +++ b/man/man8/tc-tunnel_key.8 @@ -59,12 +59,12 @@ above). .TP .B set Set tunnel metadata to be used by the IP tunnel device. Requires -.B id -, .B src_ip and .B dst_ip options. +.B id +, .B dst_port and .B geneve_opts diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c index e9e71e41..9449287e 100644 --- a/tc/m_tunnel_key.c +++ b/tc/m_tunnel_key.c @@ -25,7 +25,7 @@ static void explain(void) fprintf(stderr, " tunnel_key set \n"); fprintf(stderr, "Where TUNNEL_KEY is a combination of:\n" - "id (mandatory)\n" + "id \n" "src_ip (mandatory)\n" "dst_ip (mandatory)\n" "dst_port \n" @@ -217,7 +217,6 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p, int ret; int has_src_ip = 0; int has_dst_ip = 0; - int has_key_id = 0; int csum = 1; if (matches(*argv, "tunnel_key") != 0) @@ -273,7 +272,6 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p, fprintf(stderr, "Illegal \"id\"\n"); return -1; } - has_key_id = 1; } else if (matches(*argv, "dst_port") == 0) { NEXT_ARG(); ret = tunnel_key_parse_dst_port(*argv, @@ -335,7 +333,7 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p, } if (action == TCA_TUNNEL_KEY_ACT_SET && - (!has_src_ip || !has_dst_ip || !has_key_id)) { + (!has_src_ip || !has_dst_ip)) { fprintf(stderr, "set needs tunnel_key parameters\n"); explain(); return -1;