[Bug 119] iptc_flush_entries causes segmentation fault
bugzilla-daemon at bugzilla.netfilter.org
bugzilla-daemon at bugzilla.netfilter.org
Tue Sep 14 00:59:17 CEST 2004
https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=119
netfilter at linuxace.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |INVALID
------- Additional Comments From netfilter at linuxace.com 2004-09-14 00:59 CEST -------
Suggest you follow this example from current libiptc:
/* Flushes the entries in the given chain (ie. empties chain). */
int
TC_FLUSH_ENTRIES(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle)
{
unsigned int startindex, endindex;
STRUCT_ENTRY *startentry, *endentry;
struct chain_cache *c;
int ret;
iptc_fn = TC_FLUSH_ENTRIES;
if (!(c = find_label(chain, *handle))) {
errno = ENOENT;
return 0;
}
startindex = offset2index(*handle, c->start_off);
endindex = offset2index(*handle, c->end_off);
startentry = offset2entry(*handle, c->start_off);
endentry = offset2entry(*handle, c->end_off);
ret = delete_rules(endindex - startindex,
(char *)endentry - (char *)startentry,
c->start_off, startindex,
handle);
return ret;
}
--
Configure bugmail: https://bugzilla.netfilter.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the netfilter-buglog
mailing list