diff options
author | ru <ru@FreeBSD.org> | 2000-10-12 07:59:14 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-10-12 07:59:14 +0000 |
commit | 26ce601f70d9658c4c6e5326220f41872924930e (patch) | |
tree | a2407f29ccbc751a39609730dfe9dac082121bff /sbin | |
parent | acecaa1fc20521bb074aac431cdae4193ce27ee6 (diff) | |
download | FreeBSD-src-26ce601f70d9658c4c6e5326220f41872924930e.zip FreeBSD-src-26ce601f70d9658c4c6e5326220f41872924930e.tar.gz |
Allow for IP_FW_ADD to be used in getsockopt(2) incarnation as
well, in which case return the rule number back into userland.
PR: bin/18351
Reviewed by: archie, luigi
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c index 1923efd..d24280a 100644 --- a/sbin/ipfw/ipfw.c +++ b/sbin/ipfw/ipfw.c @@ -2131,11 +2131,11 @@ badviacombo: rule.fw_loghighest = rule.fw_logamount; } done: + i = sizeof(rule); + if (getsockopt(s, IPPROTO_IP, IP_FW_ADD, &rule, &i) == -1) + err(EX_UNAVAILABLE, "getsockopt(%s)", "IP_FW_ADD"); if (!do_quiet) show_ipfw(&rule, 10, 10); - i = setsockopt(s, IPPROTO_IP, IP_FW_ADD, &rule, sizeof rule); - if (i) - err(EX_UNAVAILABLE, "setsockopt(%s)", "IP_FW_ADD"); } static void |