File: 0003-Backported-IPv6-mask-fix.patch

package info (click to toggle)
python-iptables 0.11.0-4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 652 kB
  • ctags: 1,098
  • sloc: python: 2,709; makefile: 93; ansic: 77
file content (23 lines) | stat: -rw-r--r-- 724 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From b4ddec7db556d08b8fbd50522060afcd149a7714 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig=20=28Debian/GNU=29?=
 <umlaeute@debian.org>
Date: Fri, 28 Apr 2017 22:19:05 +0200
Subject: Backported IPv6 mask fix

---
 iptc/ip6tc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptc/ip6tc.py b/iptc/ip6tc.py
index 1611525..84deeda 100644
--- a/iptc/ip6tc.py
+++ b/iptc/ip6tc.py
@@ -273,7 +273,7 @@ class Rule6(Rule):
             if plen >= 8:
                 mask.append(0xff)
             elif plen > 0:
-                mask.append(2 ** plen - 1)
+                mask.append(0xff>>(8-plen)<<(8-plen))
             else:
                 mask.append(0x00)
             plen -= 8