Re: [libdnet-devel] dnet fw add fix
Status: Abandoned
Brought to you by:
dugsong
|
From: Dug S. <du...@mo...> - 2005-02-08 20:57:41
|
thanks, i've added this for both the add and delete case.
not sure how it worked before, but it did... :-/
On Tue, Feb 08, 2005 at 12:02:01PM -0800, Michael Coulter wrote:
> 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;
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> libdnet-devel mailing list
> lib...@li...
> https://lists.sourceforge.net/lists/listinfo/libdnet-devel
-d.
---
http://monkey.org/~dugsong/
|