Navigation Menu

Skip to content

Commit

Permalink
Store pointer to backend buffer.
Browse files Browse the repository at this point in the history
In a target or match object self._module.t should point to the backing
buffer (self._ptr). The new API x6_parse() function and extensions expect
this.
  • Loading branch information
ldx committed Jan 25, 2013
1 parent 16e88f1 commit 17866b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iptc/__init__.py
Expand Up @@ -467,6 +467,7 @@ def reset(self):
self._flags = ct.c_uint(0)
if self._module.init:
self._module.init(self._ptr)
self._module.m = self._ptr

def _get_match(self):
return ct.cast(ct.byref(self.match_buf), ct.POINTER(xt_entry_match))[0]
Expand Down Expand Up @@ -598,6 +599,7 @@ def reset(self):
self._flags = ct.c_uint(0)
if self._module.init:
self._module.init(self._ptr)
self._module.t = self._ptr

def _get_target(self):
return ct.cast(ct.byref(self.target_buf),
Expand Down

0 comments on commit 17866b9

Please sign in to comment.