netlib/iptables: Change matching to memcmp all related structs
Compare both the struct ipt_ip, the match and the target, to support more entry types other than NAT entry. Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
bc68d954ad
commit
9fcde632a7
@ -515,9 +515,9 @@ int netlib_ipt_delete(FAR struct ipt_replace *repl,
|
|||||||
{
|
{
|
||||||
if (e->next_offset == entry->next_offset &&
|
if (e->next_offset == entry->next_offset &&
|
||||||
e->target_offset == entry->target_offset &&
|
e->target_offset == entry->target_offset &&
|
||||||
strcmp(e->ip.outiface, entry->ip.outiface) == 0 &&
|
memcmp(&e->ip, &entry->ip, sizeof(struct ipt_ip)) == 0 &&
|
||||||
strcmp(IPT_TARGET(e)->u.user.name,
|
memcmp(&e->elems, &entry->elems,
|
||||||
IPT_TARGET(entry)->u.user.name) == 0)
|
e->next_offset - offsetof(struct ipt_entry, elems)) == 0)
|
||||||
{
|
{
|
||||||
netlib_ipt_delete_internal(repl, e, hook);
|
netlib_ipt_delete_internal(repl, e, hook);
|
||||||
return OK;
|
return OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user