aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2024-06-01 18:07:22 +0000
committerKristof Provost <kp@FreeBSD.org>2024-06-04 12:59:59 +0000
commitc36c90a2cc171d21f78a6f0e28269c0cea37c2e1 (patch)
tree457785194878320faea87df5b8d96ea9530876c4 /sbin
parent71d3c7041d7021ae15ff3b366b6cba9e4190283e (diff)
downloadsrc-c36c90a2cc171d21f78a6f0e28269c0cea37c2e1.tar.gz
src-c36c90a2cc171d21f78a6f0e28269c0cea37c2e1.zip
pf: convert DIOCSETDEBUG to netlink
Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y2
-rw-r--r--sbin/pfctl/pfctl.c8
-rw-r--r--sbin/pfctl/pfctl_parser.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 9ec86f898240..92e6e36f3b23 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -763,7 +763,7 @@ option : SET REASSEMBLE yesno optnodf {
free($3);
YYERROR;
}
- if (pfctl_set_debug(pf, $3) != 0) {
+ if (pfctl_do_set_debug(pf, $3) != 0) {
yyerror("error setting debuglevel %s", $3);
free($3);
YYERROR;
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 08c3d5c98321..8776ec7f82dc 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -2695,7 +2695,7 @@ pfctl_cfg_syncookies(struct pfctl *pf, uint8_t val, struct pfctl_watermarks *w)
}
int
-pfctl_set_debug(struct pfctl *pf, char *d)
+pfctl_do_set_debug(struct pfctl *pf, char *d)
{
u_int32_t level;
@@ -2719,7 +2719,7 @@ pfctl_set_debug(struct pfctl *pf, char *d)
level = pf->debug;
if ((pf->opts & PF_OPT_NOACTION) == 0)
- if (ioctl(dev, DIOCSETDEBUG, &level))
+ if (pfctl_set_debug(pfh, level))
err(1, "DIOCSETDEBUG");
if (pf->opts & PF_OPT_VERBOSE)
@@ -2731,7 +2731,7 @@ pfctl_set_debug(struct pfctl *pf, char *d)
int
pfctl_load_debug(struct pfctl *pf, unsigned int level)
{
- if (ioctl(pf->dev, DIOCSETDEBUG, &level)) {
+ if (pfctl_set_debug(pf->h, level)) {
warnx("DIOCSETDEBUG");
return (1);
}
@@ -2777,7 +2777,7 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how)
void
pfctl_debug(int dev, u_int32_t level, int opts)
{
- if (ioctl(dev, DIOCSETDEBUG, &level))
+ if (pfctl_set_debug(pfh, level))
err(1, "DIOCSETDEBUG");
if ((opts & PF_OPT_QUIET) == 0) {
fprintf(stderr, "debug level set to '");
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 6534baa9a7dd..58532ad37e12 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -291,7 +291,7 @@ int pfctl_set_optimization(struct pfctl *, const char *);
int pfctl_set_limit(struct pfctl *, const char *, unsigned int);
int pfctl_set_logif(struct pfctl *, char *);
int pfctl_set_hostid(struct pfctl *, u_int32_t);
-int pfctl_set_debug(struct pfctl *, char *);
+int pfctl_do_set_debug(struct pfctl *, char *);
int pfctl_set_interface_flags(struct pfctl *, char *, int, int);
int pfctl_cfg_syncookies(struct pfctl *, uint8_t, struct pfctl_watermarks *);