aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/ufw/ufw/0004-lp1039729.patch
blob: 695b265671a3f49233e72557c68c3ffca772505c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Origin: r803, r804
Description: Don't call get_netfilter_capabilities() with ipv6 if ipv6 is
 disabled.
Bug-Ubuntu: https://launchpad.net/ufw/bugs/1039729

Upstream-Status: Inappropriate [ not author ]

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>

Index: ufw-0.33/src/backend.py
===================================================================
--- ufw-0.33.orig/src/backend.py	2012-12-04 09:21:57.000000000 -0600
+++ ufw-0.33/src/backend.py	2012-12-04 09:22:40.000000000 -0600
@@ -98,15 +98,17 @@
             else:
                 self.caps['limit']['4'] = False
 
-            # v6
-            try:
-                nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables)
-            except OSError as e:
-                error("initcaps\n%s" % e)
-            if 'recent-set' in nf_caps and 'recent-update' in nf_caps:
-                self.caps['limit']['6'] = True
-            else:
-                self.caps['limit']['6'] = False
+            # v6 (skip capabilities check for ipv6 if ipv6 is disabled in ufw
+            # because the system may not have ipv6 support (LP: #1039729)
+            if self.use_ipv6():
+                try:
+                    nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables)
+                except OSError as e:
+                    error("initcaps\n%s" % e)
+                if 'recent-set' in nf_caps and 'recent-update' in nf_caps:
+                    self.caps['limit']['6'] = True
+                else:
+                    self.caps['limit']['6'] = False
 
     def is_enabled(self):
         '''Is firewall configured as enabled'''