diff options
author | Lutz Donnerhacke <donner@FreeBSD.org> | 2021-05-02 20:47:04 +0000 |
---|---|---|
committer | Lutz Donnerhacke <donner@FreeBSD.org> | 2021-05-17 06:16:45 +0000 |
commit | 370c8a1f784c62d0cf28aa1202a0575add1b3559 (patch) | |
tree | 9ef0e954baeadd647a85fc8280f3f70c0f9fd592 | |
parent | fb2dd85a9483b5731d75ace0f29850f1802cfeae (diff) | |
download | src-370c8a1f784c62d0cf28aa1202a0575add1b3559.tar.gz src-370c8a1f784c62d0cf28aa1202a0575add1b3559.zip |
service/ipfw: Silence warning on restart
Once the ipfw0 interface has been created, ifconfig(8) create will
throw a warning: "ifconfig: create: bad value" when trying to create
it again.
PR: 241013
Submitted by: Jose Luis Duran
Approved by: kp
Differential Revision: https://reviews.freebsd.org/D30083
(cherry picked from commit 5c4fe2ac81a5e05062266d684fb53b9faefd0d38)
-rwxr-xr-x | etc/rc.d/ipfw | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/rc.d/ipfw b/etc/rc.d/ipfw index ef85e3d88d13..b93d16026fe4 100755 --- a/etc/rc.d/ipfw +++ b/etc/rc.d/ipfw @@ -74,8 +74,14 @@ ipfw_start() ${SYSCTL} net.inet.ip.fw.verbose=1 >/dev/null fi if checkyesno firewall_logif; then - ifconfig ipfw0 create - echo 'Firewall logging pseudo-interface (ipfw0) created.' + if ! ifconfig ipfw0 >/dev/null 2>&1; then + ifconfig ipfw0 create + echo 'Firewall logging pseudo-interface (ipfw0)' \ + 'created.' + else + echo 'Firewall logging pseudo-interface (ipfw0)' \ + 'already created.' + fi fi } |