diff options
author | Kristof Provost <kp@FreeBSD.org> | 2024-03-18 09:56:25 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2024-03-19 15:30:08 +0000 |
commit | 470a2b3346612fbf2f6415ec8df63c92703035dd (patch) | |
tree | 99b74c2280942ce4183fbc0b314f2fdf90c01368 /sbin/pfctl | |
parent | c6f1116357904d3c2e95430e27213e4d0948fc64 (diff) | |
download | src-470a2b3346612fbf2f6415ec8df63c92703035dd.tar.gz src-470a2b3346612fbf2f6415ec8df63c92703035dd.zip |
pf: convert DIOCSETSTATUSIF to netlink
While here also add a basic test case for it.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44368
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/pfctl.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index f8ecded066d2..8d59871701f8 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2547,19 +2547,11 @@ pfctl_set_logif(struct pfctl *pf, char *ifname) int pfctl_load_logif(struct pfctl *pf, char *ifname) { - struct pfioc_if pi; - - memset(&pi, 0, sizeof(pi)); - if (ifname && strlcpy(pi.ifname, ifname, - sizeof(pi.ifname)) >= sizeof(pi.ifname)) { + if (ifname != NULL && strlen(ifname) >= IFNAMSIZ) { warnx("pfctl_load_logif: strlcpy"); return (1); } - if (ioctl(pf->dev, DIOCSETSTATUSIF, &pi)) { - warnx("DIOCSETSTATUSIF"); - return (1); - } - return (0); + return (pfctl_set_statusif(pfh, ifname ? ifname : "")); } int |