mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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
1 changed files with 3 additions and 3 deletions
|
|
@ -515,9 +515,9 @@ int netlib_ipt_delete(FAR struct ipt_replace *repl,
|
|||
{
|
||||
if (e->next_offset == entry->next_offset &&
|
||||
e->target_offset == entry->target_offset &&
|
||||
strcmp(e->ip.outiface, entry->ip.outiface) == 0 &&
|
||||
strcmp(IPT_TARGET(e)->u.user.name,
|
||||
IPT_TARGET(entry)->u.user.name) == 0)
|
||||
memcmp(&e->ip, &entry->ip, sizeof(struct ipt_ip)) == 0 &&
|
||||
memcmp(&e->elems, &entry->elems,
|
||||
e->next_offset - offsetof(struct ipt_entry, elems)) == 0)
|
||||
{
|
||||
netlib_ipt_delete_internal(repl, e, hook);
|
||||
return OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue