From: Mark Wooding Date: Thu, 28 Sep 2017 18:12:54 +0000 (+0100) Subject: svc/conntrack.in (strmask): Consistently return a string object. X-Git-Tag: 1.5.0~41^2~14 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/b7c1665d8683c76af494214037e1fe8869c22432 svc/conntrack.in (strmask): Consistently return a string object. Inexplicably, this used to return an integer if the mask covered a prefix. Fortunately, it was always invoked in order to produce a thing which is printed via `%s', which stringifies anyway. --- diff --git a/svc/conntrack.in b/svc/conntrack.in index 1b9f5819..a55e4c32 100644 --- a/svc/conntrack.in +++ b/svc/conntrack.in @@ -197,7 +197,7 @@ CF = None def straddr(a): return a is None and '#' or S.inet_ntoa(pack('>L', a)) def strmask(m): for i in xrange(33): - if m == 0xffffffff ^ ((1 << (32 - i)) - 1): return i + if m == 0xffffffff ^ ((1 << (32 - i)) - 1): return str(i) return straddr(m) def cmd_showconfig():