Page MenuHomeFreeBSD

Fix ipfw/dnctl detection
ClosedPublic

Authored by meka_tilda.center on Nov 18 2022, 5:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 12, 12:27 AM
Unknown Object (File)
Tue, Mar 12, 12:27 AM
Unknown Object (File)
Tue, Mar 12, 12:23 AM
Unknown Object (File)
Tue, Mar 12, 12:23 AM
Unknown Object (File)
Tue, Mar 12, 12:23 AM
Unknown Object (File)
Fri, Mar 8, 4:06 AM
Unknown Object (File)
Jan 6 2024, 3:07 AM
Unknown Object (File)
Jan 6 2024, 3:07 AM
Subscribers

Details

Summary

This diff fixes ipfw/dnctl detection. The bug it fixes is that running "dnctl" vs "/sbin/dnctl" gives different results.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

It looks like patch does two different things. That really needs to be two separate commits. One to add the dnctl startup script, and one to fix the dnctl/ipfw detection.

sbin/ipfw/main.c
685

That catches a problem, but I believe the usual way of fixing this is with basename(3).
That'll be a lot simpler than this string manipulation.

BASENAME(3)             FreeBSD Library Functions Manual             BASENAME(3)

NAME
     basename – extract the base portion of a pathname

SYNOPSIS
     #include <libgen.h>

     char *
     basename(char *path);

DESCRIPTION
     The basename() function returns the last component from the pathname
     pointed to by path, deleting any trailing ‘/’ characters.
meka_tilda.center retitled this revision from Fix ipfw/dnctl detection and add dnctl rc.d service to Fix ipfw/dnctl detection.
meka_tilda.center edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Nov 22 2022, 9:41 AM
Closed by commit rG3599da158e39: ipfw: Fix ipfw/dnctl detection (authored by meka_tilda.center, committed by kp). · Explain Why
This revision was automatically updated to reflect the committed changes.