Summary: | ipfw: Silence firewall_logif on ipfw service restart | ||
---|---|---|---|
Product: | Base System | Reporter: | Jose Luis Duran <jlduran> |
Component: | conf | Assignee: | Lutz Donnerhacke <donner> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | donner, ipfw |
Priority: | --- | Keywords: | patch |
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any | ||
Attachments: |
(In reply to Jose Luis Duran from comment #0) The warning message is more descriptive now. Not sure if silencing it is really a benefit: ifconfig: interface ipfw0 already exists Created attachment 216277 [details]
Disable logging and destroy ipfw0 interface upon service stop
Second option just in case.
I oppose this approach. Modifying a sysctl value in the background is surprising to the user. I do not see any code for retaining the old value for the next usage. So if the service is restarted, the log-sysctl value will unconditionally lost and any new messages will be suppressed. (In reply to lutz from comment #3) That is understandable. Attached is patch3 (also just in case) which disables only the interface. Created attachment 216298 [details]
Disable the interface ipfw0 upon service stop
Destroy just the interface and leave the sysctl on. (option 3).
Created attachment 216416 [details]
Less destructive approach
Take 4: Do not attempt to create interface if it already exists.
Created attachment 216419 [details]
Tell the user if the interface already existed
Please have a look at: https://reviews.freebsd.org/D30083 A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4fe2ac81a5e05062266d684fb53b9faefd0d38 commit 5c4fe2ac81a5e05062266d684fb53b9faefd0d38 Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-05-02 20:47:04 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-05-03 10:27:20 +0000 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 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30083 libexec/rc/rc.d/ipfw | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e0f2b8aaf1ed210c571b8a75749d072570eac88c commit e0f2b8aaf1ed210c571b8a75749d072570eac88c Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-05-02 20:47:04 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-05-17 06:08:41 +0000 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) libexec/rc/rc.d/ipfw | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9ad87c22530d0244e04132b9eae2cb4524e23f2b commit 9ad87c22530d0244e04132b9eae2cb4524e23f2b Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-05-02 20:47:04 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-05-17 06:12:11 +0000 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) libexec/rc/rc.d/ipfw | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) A commit in branch stable/11 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=370c8a1f784c62d0cf28aa1202a0575add1b3559 commit 370c8a1f784c62d0cf28aa1202a0575add1b3559 Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-05-02 20:47:04 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> CommitDate: 2021-05-17 06:16:45 +0000 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) etc/rc.d/ipfw | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) |
Created attachment 208032 [details] Silence firewall_logif on ipfw service 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. This patch silences it.