aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Donnerhacke <donner@FreeBSD.org>2021-05-02 20:47:04 +0000
committerLutz Donnerhacke <donner@FreeBSD.org>2021-05-17 06:12:11 +0000
commit9ad87c22530d0244e04132b9eae2cb4524e23f2b (patch)
treeda839247290fdb03790eb3398b154eb18fde3319
parenta7e6401ac7cc8acfbabab9aad8f6acb743d4d156 (diff)
downloadsrc-9ad87c22530d0244e04132b9eae2cb4524e23f2b.tar.gz
src-9ad87c22530d0244e04132b9eae2cb4524e23f2b.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-xlibexec/rc/rc.d/ipfw10
1 files changed, 8 insertions, 2 deletions
diff --git a/libexec/rc/rc.d/ipfw b/libexec/rc/rc.d/ipfw
index ced473a5aac4..50d95543023d 100755
--- a/libexec/rc/rc.d/ipfw
+++ b/libexec/rc/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
}