summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2007-08-26 18:38:31 +0000
committermaxim <maxim@FreeBSD.org>2007-08-26 18:38:31 +0000
commit3eb0fa1342d0b24e14ff06361e7b8a71c4441b06 (patch)
tree2dc24dd997e8158a335df7e434231c8a5e0a35eb /sys
parent64c3de9e17e1278b9e185a47e24a4e63d7a9bb5e (diff)
downloadFreeBSD-src-3eb0fa1342d0b24e14ff06361e7b8a71c4441b06.zip
FreeBSD-src-3eb0fa1342d0b24e14ff06361e7b8a71c4441b06.tar.gz
o Fix bug I introduced in the previous commit (ipfw set extention):
pack a set number correctly. Submitted by: oleg o Plug a memory leak. Submitted by: oleg and Andrey V. Elsukov Approved by: re (kensmith) MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_fw2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index 576da69..b4cb78c 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -4404,7 +4404,8 @@ ipfw_getrules(struct ip_fw_chain *chain, void *buf, size_t space)
* store set number into high word of
* dst->rule pointer.
*/
- bcopy(&(p->rule->set), &dst->rule +
+ bcopy(&(p->rule->set),
+ (char *)&dst->rule +
sizeof(p->rule->rulenum),
sizeof(p->rule->set));
/*
@@ -5042,6 +5043,8 @@ ipfw_destroy(void)
reap_rules(reap);
IPFW_DYN_LOCK_DESTROY();
uma_zdestroy(ipfw_dyn_rule_zone);
+ if (ipfw_dyn_v != NULL)
+ free(ipfw_dyn_v, M_IPFW);
IPFW_LOCK_DESTROY(&layer3_chain);
#ifdef INET6
OpenPOWER on IntegriCloud