Bug 263011 - /usr/sbin/mountd warning "No mask specified for network, using out-of-date default"
Summary: /usr/sbin/mountd warning "No mask specified for network, using out-of-date de...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-02 18:50 UTC by Peter Much
Modified: 2023-09-12 16:43 UTC (History)
7 users (show)

See Also:
i.dani: maintainer-feedback? (rmacklem)
i.dani: maintainer-feedback? (karels)
i.dani: maintainer-feedback? (bcr)
karels: mfc-stable14+
karels: mfc-stable13+


Attachments
place warning later (1.30 KB, patch)
2022-04-02 18:50 UTC, Peter Much
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Much 2022-04-02 18:50:42 UTC
Created attachment 232902 [details]
place warning later

The warning was introduced per 92aebdeaff5
But it is not always true. 

This one is okay, as expected:
/ext            -network=192.168.99.1/27
This one gives the warning, not as expected:
/ext            -network=192.168.99.1 -mask=255.255.255.240
But swapping the parameters, it gets accepted:
/ext            -mask=255.255.255.240 -network=192.168.99.1

The behaviour is obvious from the source.

There is no effective harm done, only the warning is quite imperative, so that one will search for a mistake where assumably none is.

I tried a quick fix, as attached.
Comment 1 OlivierW 2022-07-31 13:04:30 UTC
Hello,

Thanks Peter for the patch!
For now, I fixed like you did, I changed the order of -mask=… and -network=…

Hoping the patch will be merged soon.

Best Regards,
Olivier
Comment 2 Dani I. 2023-09-07 14:51:27 UTC
We're also affected by this. Tagging the people from review D32713 - please take a look at the patch - thanks! :)
Comment 3 Mike Karels freebsd_committer freebsd_triage 2023-09-07 16:21:59 UTC
Thanks for the poke, I hadn't noticed this bug.  The patch seems OK modulo formatting; I'll put it in review.
Comment 4 Mike Karels freebsd_committer freebsd_triage 2023-09-07 16:56:20 UTC
(In reply to Mike Karels from comment #3)
https://reviews.freebsd.org/D41774
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-09-08 14:07:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=48514c5724cdf3338dd6d220e5deee6178d7ee48

commit 48514c5724cdf3338dd6d220e5deee6178d7ee48
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-09-08 14:06:42 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-09-08 14:06:42 +0000

    mountd: do not warn about using class mask with -mask

    The previous code would warn that the mask was being defaulted to
    an obsolete class mask even if -mask was present after -network.
    Import a fix from Peter Much with a little tweaking, deferring the
    warning until after all parameters are processed.

    PR:             263011
    Obtained from:  pmc at citilink.dinoex.sub.org
    MFC after:      3 days
    Reviewed by:    rmacklem
    Differential Revision:  https://reviews.freebsd.org/D41774

 usr.sbin/mountd/mountd.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-09-12 14:19:44 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=deaa6984ada80e36aea2f16e5f7211dd0d14800c

commit deaa6984ada80e36aea2f16e5f7211dd0d14800c
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-09-08 14:06:42 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-09-12 14:18:52 +0000

    mountd: do not warn about using class mask with -mask

    The previous code would warn that the mask was being defaulted to
    an obsolete class mask even if -mask was present after -network.
    Import a fix from Peter Much with a little tweaking, deferring the
    warning until after all parameters are processed.

    PR:             263011
    Obtained from:  pmc at citilink.dinoex.sub.org
    Reviewed by:    rmacklem
    Differential Revision:  https://reviews.freebsd.org/D41774

    (cherry picked from commit 48514c5724cdf3338dd6d220e5deee6178d7ee48)

 usr.sbin/mountd/mountd.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-09-12 14:19:46 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=79ce96abd6c5dee2ddb2e35755c7ff9156510d81

commit 79ce96abd6c5dee2ddb2e35755c7ff9156510d81
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-09-08 14:06:42 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-09-12 14:18:33 +0000

    mountd: do not warn about using class mask with -mask

    The previous code would warn that the mask was being defaulted to
    an obsolete class mask even if -mask was present after -network.
    Import a fix from Peter Much with a little tweaking, deferring the
    warning until after all parameters are processed.

    PR:             263011
    Obtained from:  pmc at citilink.dinoex.sub.org
    Reviewed by:    rmacklem
    Differential Revision:  https://reviews.freebsd.org/D41774

    (cherry picked from commit 48514c5724cdf3338dd6d220e5deee6178d7ee48)

 usr.sbin/mountd/mountd.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-09-12 16:40:23 UTC
A commit in branch releng/14.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6af462f0ec36fd8c2f1a679932e71e4afe438be4

commit 6af462f0ec36fd8c2f1a679932e71e4afe438be4
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-09-08 14:06:42 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-09-12 16:39:46 +0000

    mountd: do not warn about using class mask with -mask

    The previous code would warn that the mask was being defaulted to
    an obsolete class mask even if -mask was present after -network.
    Import a fix from Peter Much with a little tweaking, deferring the
    warning until after all parameters are processed.

    PR:             263011
    Obtained from:  pmc at citilink.dinoex.sub.org
    Approved by:    re (gjb)
    Reviewed by:    rmacklem
    Differential Revision:  https://reviews.freebsd.org/D41774

    (cherry picked from commit 48514c5724cdf3338dd6d220e5deee6178d7ee48)
    (cherry picked from commit deaa6984ada80e36aea2f16e5f7211dd0d14800c)

 usr.sbin/mountd/mountd.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
Comment 9 Mike Karels freebsd_committer freebsd_triage 2023-09-12 16:43:20 UTC
Now on stable/14, stable/13 and releng/14.0