From 1e831468c4b2ac63fde9c10100979d310441c9c5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 14 Feb 2019 15:28:02 +0800 Subject: [PATCH] ipfw3: Fix several comments and error messages --- sbin/ipfw3/ipfw3.c | 4 ++-- sys/net/ipfw3/ip_fw3.c | 2 +- sys/netinet/in.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/ipfw3/ipfw3.c b/sbin/ipfw3/ipfw3.c index 072e571947..09a5f9152d 100644 --- a/sbin/ipfw3/ipfw3.c +++ b/sbin/ipfw3/ipfw3.c @@ -600,7 +600,7 @@ done: rule->cmd_len = (u_int32_t *)dst - (u_int32_t *)(rule->cmd); i = (void *)dst - (void *)rule; if (do_set_x(IP_FW_ADD, (void *)rule, i) == -1) { - err(EX_UNAVAILABLE, "getsockopt(%s)", "IP_FW_ADD"); + err(EX_UNAVAILABLE, "setsockopt(%s)", "IP_FW_ADD"); } if (!do_quiet) rule_show(rule, 10, 10); @@ -892,7 +892,7 @@ done: } /* - * do_set_x - extended version og do_set + * do_set_x - extended version of do_set * insert a x_header in the beginning of the rule buf * and call setsockopt() with IP_FW_X. */ diff --git a/sys/net/ipfw3/ip_fw3.c b/sys/net/ipfw3/ip_fw3.c index edda03f21e..3ecb8474ac 100644 --- a/sys/net/ipfw3/ip_fw3.c +++ b/sys/net/ipfw3/ip_fw3.c @@ -1038,7 +1038,7 @@ ip_fw3_ctl_get_rules(struct sockopt *sopt) /* * ip_fw3_ctl_x - extended version of ip_fw3_ctl - * remove the x_header, and adjust the sopt_name,sopt_val and sopt_valsize. + * remove the x_header, and adjust the sopt_name, sopt_val and sopt_valsize. */ int ip_fw3_ctl_x(struct sockopt *sopt) diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 2f6fac974f..2873a8ac99 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -358,7 +358,8 @@ struct sockaddr_in { #define IP_FW_TBL_ZERO 46 /* clear ipfw table counters */ #define IP_FW_TBL_EXPIRE 47 /* expire addresses in ipfw table */ -#define IP_FW_X 49 /* ipfw2 firewall */ +#define IP_FW_X 49 /* ipfw3 firewall */ + #define IP_FW_ADD 50 /* add a firewall rule to chain */ #define IP_FW_DEL 51 /* delete a firewall rule from chain */ #define IP_FW_FLUSH 52 /* flush firewall rule chain */ -- 2.41.0