aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2025-01-07 10:55:05 +0000
committerKristof Provost <kp@FreeBSD.org>2025-01-14 08:54:17 +0000
commit4aafc73d1255a92463d2ee73cea381462775e64a (patch)
tree0b0c8b8de51467a612eace5316c2ae4c8bb5012b
parent441d489493e8a1e2658306f1a4c709a0b18cc78b (diff)
pfctl: pfctl_set_hostid always returns 0
Don't pretend otherwise and make it a void function instead. ok dlg Obtained from: OpenBSD, mcbride <mcbride@openbsd.org>, 9ac6101ff7 Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--sbin/pfctl/parse.y5
-rw-r--r--sbin/pfctl/pfctl.c6
-rw-r--r--sbin/pfctl/pfctl_parser.h2
3 files changed, 4 insertions, 9 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index fc9cf86081f6..63bee3ab6a1c 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -702,10 +702,7 @@ option : SET REASSEMBLE yesno optnodf {
yyerror("hostid must be non-zero");
YYERROR;
}
- if (pfctl_set_hostid(pf, $3) != 0) {
- yyerror("error setting hostid %08x", $3);
- YYERROR;
- }
+ pfctl_set_hostid(pf, $3);
}
| SET BLOCKPOLICY DROP {
if (pf->opts & PF_OPT_VERBOSE)
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 190d1a382c03..4b2a69f456a2 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -2571,11 +2571,11 @@ pfctl_load_logif(struct pfctl *pf, char *ifname)
return (pfctl_set_statusif(pfh, ifname ? ifname : ""));
}
-int
+void
pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid)
{
if ((loadopt & PFCTL_FLAG_OPTION) == 0)
- return (0);
+ return;
HTONL(hostid);
@@ -2584,8 +2584,6 @@ pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid)
if (pf->opts & PF_OPT_VERBOSE)
printf("set hostid 0x%08x\n", ntohl(hostid));
-
- return (0);
}
int
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 551f2ff7537c..2b0766dfd99f 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -290,7 +290,7 @@ int pfctl_set_reassembly(struct pfctl *, int, int);
int pfctl_set_optimization(struct pfctl *, const char *);
int pfctl_apply_limit(struct pfctl *, const char *, unsigned int);
int pfctl_set_logif(struct pfctl *, char *);
-int pfctl_set_hostid(struct pfctl *, u_int32_t);
+void pfctl_set_hostid(struct pfctl *, u_int32_t);
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 *);