[libdnet-devel] dnet fw add fix
Status: Abandoned
Brought to you by:
dugsong
|
From: Michael C. <mj...@bi...> - 2005-02-08 20:00:24
|
Not sure how recent the change is in pf, but I needed this to make rule
addition work in OpenBSD-current.
Index: fw-pf.c
===================================================================
RCS file: /cvsroot/libdnet/libdnet/src/fw-pf.c,v
retrieving revision 1.16
diff -u -r1.16 fw-pf.c
--- fw-pf.c 19 Aug 2004 17:36:53 -0000 1.16
+++ fw-pf.c 8 Feb 2005 19:55:24 -0000
@@ -181,7 +181,8 @@
fw_add(fw_t *fw, const struct fw_rule *rule)
{
struct pfioc_changerule pcr;
-
+ struct pfioc_pooladdr pool;
+
assert(fw != NULL && rule != NULL);
memset(&pcr, 0, sizeof(pcr));
fr_to_pr(rule, &pcr.newrule);
@@ -189,6 +190,9 @@
pcr.action = PF_CHANGE_GET_TICKET;
if (ioctl(fw->fd, DIOCCHANGERULE, &pcr) < 0)
return (-1);
+ if((ioctl(fw->fd, DIOCBEGINADDRS, &pool)) < 0)
+ return (-1);
+ pcr.pool_ticket = pool.ticket;
#endif
pcr.action = PF_CHANGE_ADD_TAIL;
|