Update to 4.15, fix /bin/ss with no header flag
authorRené Jochum <rene@jochums.at>
Mon, 18 Jun 2018 09:57:54 +0000 (11:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 Jun 2018 07:42:51 +0000 (09:42 +0200)
Fix ss with the no-header flag, upstream bug: #895719

Signed-off-by: René Jochum <rene@jochums.at>
.gitignore
Makefile
debian/changelog
debian/patches/0002-txtdocs.patch [deleted file]
debian/patches/0005-revert-flush-default.patch [new file with mode: 0644]
debian/patches/0005-tc-lexer-let-quotes-actually-start-strings.patch [deleted file]
debian/patches/0006-police-don-t-skip-parameters-after-actions.patch [deleted file]
debian/patches/0099-fix-ss-no-header-renderer.patch [new file with mode: 0644]
debian/patches/series
debian/rules

index 34ea9d5..d8127a8 100644 (file)
@@ -1 +1,4 @@
 iproute2-*
+*.deb
+*.buildinfo
+*.changes
\ No newline at end of file
index 9788367..e043d81 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION=4.13.0
-PKGREL=3
+VERSION=4.15.0
+PKGREL=4
 
 DIR=iproute2-${VERSION}
 SRC=iproute2-${VERSION}.orig.tar.xz
index 93d41ca..3ad30e7 100644 (file)
@@ -1,3 +1,16 @@
+iproute2 (4.15.0-4) UNRELEASED; urgency=medium
+
+  * Fix ss with the no-header flag, upstream bug: #895719
+
+ -- Proxmox Support Team <support@proxmox.com>  Sun, 15 Apr 2018 09:29:03 +0200
+
+iproute2 (4.15.0-3) unstable; urgency=medium
+
+  * Backport 0005-revert-flush-default.patch to fix ip route flush all
+    (Closes: #891511)
+
+ -- Luca Boccassi <bluca@debian.org>  Mon, 12 Mar 2018 22:46:24 +0000
+
 iproute2 (4.13.0-3) unstable; urgency=medium
 
   * merge patch to not skip parameters after actions in 'police' filter lines
diff --git a/debian/patches/0002-txtdocs.patch b/debian/patches/0002-txtdocs.patch
deleted file mode 100644 (file)
index 590a232..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Debian iproute2 Maintainers <ah-iproute@debian.org>
-Date: Mon, 10 Jun 2013 11:47:00 +0200
-Subject: txtdocs
-
----
- doc/Makefile |    9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
---- a/doc/Makefile
-+++ b/doc/Makefile
-@@ -14,6 +14,7 @@
- PAGESPERPAGE=2
- HTMLFILES=$(subst .sgml,.html,$(shell echo *.sgml))
-+TXTFILES=$(subst .sgml,.txt,$(shell echo *.sgml))
- DVIFILES=$(subst .ps,.dvi,$(PSFILES))
- PDFFILES=$(subst .ps,.pdf,$(PSFILES))
-@@ -28,6 +29,8 @@
- pdf: $(PDFFILES)
-+txt: $(TXTFILES)
-+
- print: $(PSFILES)
-       $(LPR) $(PSFILES)
-@@ -65,9 +68,13 @@
- %.html: %.sgml
-       $(SGML2HTML) $<
-+%.txt: %.html
-+      lynx -nolist -dump $< > $@
-+
-+
- install:
-       install -m 0644 $(shell echo *.tex) $(DESTDIR)$(DOCDIR)
-       install -m 0644 $(shell echo *.sgml) $(DESTDIR)$(DOCDIR)
- clean:
--      rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html *.pdf
-+      rm -f *.aux *.log *.toc $(PSFILES) $(DVIFILES) *.html *.pdf $(TXTFILES)
diff --git a/debian/patches/0005-revert-flush-default.patch b/debian/patches/0005-revert-flush-default.patch
new file mode 100644 (file)
index 0000000..3a5b481
--- /dev/null
@@ -0,0 +1,113 @@
+Description: Revert "iproute: "list/flush/save default" selected all of the routes"
+       # ip route flush all
+ No longer worked as expected which breaks user scripts and
+ expectations. It no longer flushed all IPv4 routes.
+Bug: https://bugs.debian.og/891511
+Forwarded: not-needed
+Origin: upstream
+Applied-Upstream: https://patchwork.ozlabs.org/patch/884882/
+Author: Stephen Hemminger <stephen@networkplumber.org>
+Last-Update: 2018-03-12
+--- a/ip/iproute.c
++++ b/ip/iproute.c
+@@ -191,42 +191,20 @@
+               return 0;
+       if ((filter.tos^r->rtm_tos)&filter.tosmask)
+               return 0;
+-      if (filter.rdst.family) {
+-              if (r->rtm_family != filter.rdst.family ||
+-                  filter.rdst.bitlen > r->rtm_dst_len)
+-                      return 0;
+-      } else if (filter.rdst.flags & PREFIXLEN_SPECIFIED) {
+-              if (filter.rdst.bitlen > r->rtm_dst_len)
+-                      return 0;
+-      }
+-      if (filter.mdst.family) {
+-              if (r->rtm_family != filter.mdst.family ||
+-                  (filter.mdst.bitlen >= 0 &&
+-                   filter.mdst.bitlen < r->rtm_dst_len))
+-                      return 0;
+-      } else if (filter.mdst.flags & PREFIXLEN_SPECIFIED) {
+-              if (filter.mdst.bitlen >= 0 &&
+-                  filter.mdst.bitlen < r->rtm_dst_len)
+-                      return 0;
+-      }
+-      if (filter.rsrc.family) {
+-              if (r->rtm_family != filter.rsrc.family ||
+-                  filter.rsrc.bitlen > r->rtm_src_len)
+-                      return 0;
+-      } else if (filter.rsrc.flags & PREFIXLEN_SPECIFIED) {
+-              if (filter.rsrc.bitlen > r->rtm_src_len)
+-                      return 0;
+-      }
+-      if (filter.msrc.family) {
+-              if (r->rtm_family != filter.msrc.family ||
+-                  (filter.msrc.bitlen >= 0 &&
+-                   filter.msrc.bitlen < r->rtm_src_len))
+-                      return 0;
+-      } else if (filter.msrc.flags & PREFIXLEN_SPECIFIED) {
+-              if (filter.msrc.bitlen >= 0 &&
+-                  filter.msrc.bitlen < r->rtm_src_len)
+-                      return 0;
+-      }
++      if (filter.rdst.family &&
++          (r->rtm_family != filter.rdst.family || filter.rdst.bitlen > r->rtm_dst_len))
++              return 0;
++      if (filter.mdst.family &&
++          (r->rtm_family != filter.mdst.family ||
++           (filter.mdst.bitlen >= 0 && filter.mdst.bitlen < r->rtm_dst_len)))
++              return 0;
++      if (filter.rsrc.family &&
++          (r->rtm_family != filter.rsrc.family || filter.rsrc.bitlen > r->rtm_src_len))
++              return 0;
++      if (filter.msrc.family &&
++          (r->rtm_family != filter.msrc.family ||
++           (filter.msrc.bitlen >= 0 && filter.msrc.bitlen < r->rtm_src_len)))
++              return 0;
+       if (filter.rvia.family) {
+               int family = r->rtm_family;
+@@ -243,9 +221,7 @@
+       if (tb[RTA_DST])
+               memcpy(&dst.data, RTA_DATA(tb[RTA_DST]), (r->rtm_dst_len+7)/8);
+-      if (filter.rsrc.family || filter.msrc.family ||
+-          filter.rsrc.flags & PREFIXLEN_SPECIFIED ||
+-          filter.msrc.flags & PREFIXLEN_SPECIFIED) {
++      if (filter.rsrc.family || filter.msrc.family) {
+               if (tb[RTA_SRC])
+                       memcpy(&src.data, RTA_DATA(tb[RTA_SRC]), (r->rtm_src_len+7)/8);
+       }
+@@ -265,18 +241,15 @@
+                       memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len/8);
+       }
+-      if ((filter.rdst.family || filter.rdst.flags & PREFIXLEN_SPECIFIED) &&
+-          inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
++      if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
+               return 0;
+-      if ((filter.mdst.family || filter.mdst.flags & PREFIXLEN_SPECIFIED) &&
++      if (filter.mdst.family && filter.mdst.bitlen >= 0 &&
+           inet_addr_match(&dst, &filter.mdst, r->rtm_dst_len))
+               return 0;
+-      if ((filter.rsrc.family || filter.rsrc.flags & PREFIXLEN_SPECIFIED) &&
+-          inet_addr_match(&src, &filter.rsrc, filter.rsrc.bitlen))
++      if (filter.rsrc.family && inet_addr_match(&src, &filter.rsrc, filter.rsrc.bitlen))
+               return 0;
+-      if ((filter.msrc.family || filter.msrc.flags & PREFIXLEN_SPECIFIED) &&
+-          filter.msrc.bitlen >= 0 &&
++      if (filter.msrc.family && filter.msrc.bitlen >= 0 &&
+           inet_addr_match(&src, &filter.msrc, r->rtm_src_len))
+               return 0;
+--- a/lib/utils.c
++++ b/lib/utils.c
+@@ -658,7 +658,6 @@
+               dst->family = family;
+               dst->bytelen = 0;
+               dst->bitlen = 0;
+-              dst->flags |= PREFIXLEN_SPECIFIED;
+               return 0;
+       }
diff --git a/debian/patches/0005-tc-lexer-let-quotes-actually-start-strings.patch b/debian/patches/0005-tc-lexer-let-quotes-actually-start-strings.patch
deleted file mode 100644 (file)
index cd2d6e1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From 0df91939df1da6e72fd14ef2788984685e0aeff7 Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Date: Thu, 18 Jan 2018 10:26:12 +0100
-Subject: [PATCH iproute2] tc/lexer: let quotes actually start strings
-
-The lexer will go with the longest match, so previously
-the starting double quotes of a string would be swallowed by
-the [^ \t\r\n()]+ pattern leaving the user no way to
-actually use strings with escape sequences.
-Fix this by not allowing this case to start with double
-quotes.
-
-Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
----
-(Resent as separate thread)
- tc/emp_ematch.l | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tc/emp_ematch.l b/tc/emp_ematch.l
-index dc106759..d7a99304 100644
---- a/tc/emp_ematch.l
-+++ b/tc/emp_ematch.l
-@@ -137,7 +137,7 @@
- ")"                                   {
-                                               return yylval.i = *yytext;
-                                       }
--[^ \t\r\n()]+                         {
-+[^" \t\r\n()][^ \t\r\n()]*            {
-                                               yylval.b = bstr_alloc(yytext);
-                                               if (yylval.b == NULL)
-                                                       return ERROR;
--- 
-2.11.0
-
diff --git a/debian/patches/0006-police-don-t-skip-parameters-after-actions.patch b/debian/patches/0006-police-don-t-skip-parameters-after-actions.patch
deleted file mode 100644 (file)
index 0a0f2c3..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Wolfgang Bumiller <w.bumiller@proxmox.com>
-Date: Mon, 29 Jan 2018 11:50:55 +0100
-Subject: [PATCH iproute2] police: don't skip parameters after actions
-
-The 'parse_action_control()' helper advances the argument
-pointers to past its parsed action already, so don't
-advance it further in 'act_parse_polic()'.
-
-Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions")
-Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
----
- tc/m_police.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/tc/m_police.c b/tc/m_police.c
-index ff1dcb7d..f0878b3a 100644
---- a/tc/m_police.c
-+++ b/tc/m_police.c
-@@ -154,6 +154,7 @@ int act_parse_police(struct action_util *a, int *argc_p, char ***argv_p,
-                          matches(*argv, "goto") == 0) {
-                       if (parse_action_control(&argc, &argv, &p.action, false))
-                               return -1;
-+                      goto keep_arg;
-               } else if (strcmp(*argv, "conform-exceed") == 0) {
-                       NEXT_ARG();
-                       if (parse_action_control_slash(&argc, &argv, &p.action,
-@@ -174,8 +175,9 @@ int act_parse_police(struct action_util *a, int *argc_p, char ***argv_p,
-               } else {
-                       break;
-               }
--              ok++;
-               argc--; argv++;
-+keep_arg:
-+              ok++;
-       }
-       if (!ok)
--- 
-2.11.0
-
diff --git a/debian/patches/0099-fix-ss-no-header-renderer.patch b/debian/patches/0099-fix-ss-no-header-renderer.patch
new file mode 100644 (file)
index 0000000..ced30bf
--- /dev/null
@@ -0,0 +1,35 @@
+When ss is invoked with the no-header flag, if the query doesn't return
+any result, render() is called with 'buffer' uninitialized. This
+currently leads to a segfault. Ensure that buffer is initialized before
+rendering.
+
+The bug can be triggered with: ss -H sport = 100000
+
+Signed-off-by: Jean-Philippe Brucker <jphilippe.brucker@xxxxxxxxx>
+---
+ misc/ss.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/misc/ss.c b/misc/ss.c
+index e047f9c0..e087bef7 100644
+--- a/misc/ss.c
++++ b/misc/ss.c
+@@ -1197,10 +1197,15 @@ newline:
+ /* Render buffered output with spacing and delimiters, then free up buffers */
+ static void render(int screen_width)
+ {
+-      struct buf_token *token = (struct buf_token *)buffer.head->data;
++      struct buf_token *token;
+       int printed, line_started = 0;
+       struct column *f;
++      if (!buffer.head)
++              return;
++
++      token = (struct buf_token *)buffer.head->data;
++
+       /* Ensure end alignment of last token, it wasn't necessarily flushed */
+       buffer.tail->end += buffer.cur->len % 2;
+-- 
+2.16.2
\ No newline at end of file
index 86046a5..2272e0e 100644 (file)
@@ -1,5 +1,4 @@
 0001-Add-moo-feature.patch
-0002-txtdocs.patch
 0004-sync-iptables-header.patch
-0005-tc-lexer-let-quotes-actually-start-strings.patch
-0006-police-don-t-skip-parameters-after-actions.patch
+0005-revert-flush-default.patch
+0099-fix-ss-no-header-renderer.patch
index 2f1a1ff..0a6d6e2 100755 (executable)
@@ -27,5 +27,4 @@ override_dh_auto_configure:
        $(CROSS) dh_auto_configure
 
 override_dh_auto_build:
-       $(MAKE) -C doc all txt
        $(MAKE) KERNEL_INCLUDE=./include $(CROSS)