Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | Origin: r803, r804 |
| 2 | Description: Don't call get_netfilter_capabilities() with ipv6 if ipv6 is |
| 3 | disabled. |
| 4 | Bug-Ubuntu: https://launchpad.net/ufw/bugs/1039729 |
| 5 | |
| 6 | Upstream-Status: Inappropriate [ not author ] |
| 7 | |
| 8 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> |
| 9 | |
| 10 | Index: ufw-0.33/src/backend.py |
| 11 | =================================================================== |
| 12 | --- ufw-0.33.orig/src/backend.py 2012-12-04 09:21:57.000000000 -0600 |
| 13 | +++ ufw-0.33/src/backend.py 2012-12-04 09:22:40.000000000 -0600 |
| 14 | @@ -98,15 +98,17 @@ |
| 15 | else: |
| 16 | self.caps['limit']['4'] = False |
| 17 | |
| 18 | - # v6 |
| 19 | - try: |
| 20 | - nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables) |
| 21 | - except OSError as e: |
| 22 | - error("initcaps\n%s" % e) |
| 23 | - if 'recent-set' in nf_caps and 'recent-update' in nf_caps: |
| 24 | - self.caps['limit']['6'] = True |
| 25 | - else: |
| 26 | - self.caps['limit']['6'] = False |
| 27 | + # v6 (skip capabilities check for ipv6 if ipv6 is disabled in ufw |
| 28 | + # because the system may not have ipv6 support (LP: #1039729) |
| 29 | + if self.use_ipv6(): |
| 30 | + try: |
| 31 | + nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables) |
| 32 | + except OSError as e: |
| 33 | + error("initcaps\n%s" % e) |
| 34 | + if 'recent-set' in nf_caps and 'recent-update' in nf_caps: |
| 35 | + self.caps['limit']['6'] = True |
| 36 | + else: |
| 37 | + self.caps['limit']['6'] = False |
| 38 | |
| 39 | def is_enabled(self): |
| 40 | '''Is firewall configured as enabled''' |