blob: 8359bf5b4c03b8a526e1c25a54562e97479003f0 [file] [log] [blame]
https://github.com/ldx/python-iptables/pull/59
From 6c30ca04656062bf95a1039d6e4bc7440150b9bc Mon Sep 17 00:00:00 2001
From: Tim Harder <radhermit@gmail.com>
Date: Sat, 22 Feb 2014 01:11:40 -0800
Subject: [PATCH 2/2] Fix return and argument types for various libiptc API
calls.
---
iptc/ip4tc.py | 6 +++---
iptc/ip6tc.py | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/iptc/ip4tc.py b/iptc/ip4tc.py
index a953f41..fd3fc78 100644
--- a/iptc/ip4tc.py
+++ b/iptc/ip4tc.py
@@ -103,7 +103,7 @@ _libiptc, _ = find_library("ip4tc", "iptc") # old iptables versions use iptc
class iptc(object):
"""This class contains all libiptc API calls."""
iptc_init = _libiptc.iptc_init
- iptc_init.restype = ct.c_void_p
+ iptc_init.restype = ct.POINTER(ct.c_int)
iptc_init.argstype = [ct.c_char_p]
iptc_free = _libiptc.iptc_free
@@ -120,11 +120,11 @@ class iptc(object):
iptc_first_chain = _libiptc.iptc_first_chain
iptc_first_chain.restype = ct.c_char_p
- iptc_first_chain.argstype = [ct.c_char_p, ct.c_void_p]
+ iptc_first_chain.argstype = [ct.c_void_p]
iptc_next_chain = _libiptc.iptc_next_chain
iptc_next_chain.restype = ct.c_char_p
- iptc_next_chain.argstype = [ct.c_char_p, ct.c_void_p]
+ iptc_next_chain.argstype = [ct.c_void_p]
iptc_is_chain = _libiptc.iptc_is_chain
iptc_is_chain.restype = ct.c_int
diff --git a/iptc/ip6tc.py b/iptc/ip6tc.py
index dbf034d..10422d8 100644
--- a/iptc/ip6tc.py
+++ b/iptc/ip6tc.py
@@ -82,7 +82,7 @@ _libiptc, _ = find_library("ip6tc", "iptc") # old iptables versions use iptc
class ip6tc(object):
"""This class contains all libip6tc API calls."""
iptc_init = _libiptc.ip6tc_init
- iptc_init.restype = ct.c_void_p
+ iptc_init.restype = ct.POINTER(ct.c_int)
iptc_init.argstype = [ct.c_char_p]
iptc_free = _libiptc.ip6tc_free
@@ -99,11 +99,11 @@ class ip6tc(object):
iptc_first_chain = _libiptc.ip6tc_first_chain
iptc_first_chain.restype = ct.c_char_p
- iptc_first_chain.argstype = [ct.c_char_p, ct.c_void_p]
+ iptc_first_chain.argstype = [ct.c_void_p]
iptc_next_chain = _libiptc.ip6tc_next_chain
iptc_next_chain.restype = ct.c_char_p
- iptc_next_chain.argstype = [ct.c_char_p, ct.c_void_p]
+ iptc_next_chain.argstype = [ct.c_void_p]
iptc_is_chain = _libiptc.ip6tc_is_chain
iptc_is_chain.restype = ct.c_int
--
1.9.0