Page MenuHomeFreeBSD

D29641.id87028.diff
No OneTemporary

D29641.id87028.diff

Index: contrib/pf/ftp-proxy/filter.c
===================================================================
--- contrib/pf/ftp-proxy/filter.c
+++ contrib/pf/ftp-proxy/filter.c
@@ -28,6 +28,7 @@
#include <err.h>
#include <errno.h>
+#include <libpfctl.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
@@ -68,7 +69,8 @@
return (-1);
pfr.rule.direction = dir;
- if (ioctl(dev, DIOCADDRULE, &pfr) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
return (0);
@@ -97,12 +99,14 @@
&satosin6(nat)->sin6_addr.s6_addr, 16);
memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16);
}
- if (ioctl(dev, DIOCADDADDR, &pfp) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
pfr.rule.rpool.proxy_port[0] = nat_range_low;
pfr.rule.rpool.proxy_port[1] = nat_range_high;
- if (ioctl(dev, DIOCADDRULE, &pfr) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
return (0);
@@ -130,11 +134,13 @@
&satosin6(rdr)->sin6_addr.s6_addr, 16);
memset(&pfp.addr.addr.v.a.mask.addr8, 255, 16);
}
- if (ioctl(dev, DIOCADDADDR, &pfp) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
pfr.rule.rpool.proxy_port[0] = rdr_port;
- if (ioctl(dev, DIOCADDRULE, &pfr) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
return (0);
Index: contrib/pf/tftp-proxy/filter.c
===================================================================
--- contrib/pf/tftp-proxy/filter.c
+++ contrib/pf/tftp-proxy/filter.c
@@ -32,6 +32,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <libpfctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -72,7 +73,8 @@
return (-1);
pfr.rule.direction = dir;
- if (ioctl(dev, DIOCADDRULE, &pfr) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
return (0);
@@ -106,7 +108,8 @@
pfr.rule.rpool.proxy_port[0] = nat_range_low;
pfr.rule.rpool.proxy_port[1] = nat_range_high;
- if (ioctl(dev, DIOCADDRULE, &pfr) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
return (0);
@@ -138,7 +141,8 @@
return (-1);
pfr.rule.rpool.proxy_port[0] = rdr_port;
- if (ioctl(dev, DIOCADDRULE, &pfr) == -1)
+ if (libpfctl_add_rule(dev, &pfr.rule, pfr.anchor, pfr.anchor_call,
+ pfr.ticket, pfr.pool_ticket))
return (-1);
return (0);
Index: libexec/tftp-proxy/Makefile
===================================================================
--- libexec/tftp-proxy/Makefile
+++ libexec/tftp-proxy/Makefile
@@ -6,6 +6,9 @@
SRCS= tftp-proxy.c filter.c
MAN= tftp-proxy.8
+CFLAGS+= -I${SRCTOP}/lib/libpfctl -I${OBJTOP}/lib/libpfctl
+LIBADD= pfctl
+
WARNS?= 3
.include <bsd.prog.mk>
Index: usr.sbin/ftp-proxy/Makefile
===================================================================
--- usr.sbin/ftp-proxy/Makefile
+++ usr.sbin/ftp-proxy/Makefile
@@ -8,8 +8,9 @@
SRCS= ftp-proxy.c filter.c
CFLAGS+=-I${SRCTOP}/contrib/pf/libevent
+CFLAGS+= -I${SRCTOP}/lib/libpfctl -I${OBJTOP}/lib/libpfctl
-LIBADD= event1
+LIBADD= event1 pfctl
WARNS?= 3

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 8:59 AM (9 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14795698
Default Alt Text
D29641.id87028.diff (3 KB)

Event Timeline