Bug 289113 - [patch] ifconfig(8) should document max length of `name`
Summary: [patch] ifconfig(8) should document max length of `name`
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Alexander Ziaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-26 19:05 UTC by William Carrel
Modified: 2025-11-13 00:21 UTC (History)
2 users (show)

See Also:


Attachments
[PATCH] sbin/ifconfig/ifconfig.8 (484 bytes, text/plain)
2025-08-26 19:05 UTC, William Carrel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Carrel 2025-08-26 19:05:51 UTC
Created attachment 263255 [details]
[PATCH] sbin/ifconfig/ifconfig.8

`sys/net/if.h` limits interfaces at 16 bytes including terminating null with `IF_NAMESIZE`.

This limit is not documented in ifconfig(8) and the error messages yielded by picking a name that is too long do not make it obvious what the limit actually is. One has to dig around in /usr/src to find the actual limit.

e.g.
> ifconfig lo0 name thisnameiswaytoolongletshaveanerror42
< ifconfig: ioctl SIOCSIFNAME (set name): File name too long

The included patch documents this maximum length in the ifconfig manual page giving users a slightly better chance of finding it. The patch explains the maximum length as 15 characters to make it easier to understand and match similar limits discussed elsewhere in this manual page.
Comment 1 Michael Osipov freebsd_committer freebsd_triage 2025-08-26 19:42:18 UTC
This has been a constant problem with BastilleBSD as well...
Comment 2 Alexander Ziaee freebsd_committer freebsd_triage 2025-08-26 21:00:35 UTC
Accepted. I will merge this tonight, unless someone else wants to.
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-10-30 18:41:53 UTC
A commit in branch main references this bug:

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

commit 832cd05905980d0f6547bf02745b054c1f4af1eb
Author:     William Carrel <william.a@carrel.org>
AuthorDate: 2025-10-30 18:39:29 +0000
Commit:     Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2025-10-30 18:40:45 +0000

    ifconfig.8: Mention max name length

    PR:             289113
    MFC after:      3 days

 sbin/ifconfig/ifconfig.8 | 3 +++
 1 file changed, 3 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-11-03 23:27:58 UTC
A commit in branch stable/15 references this bug:

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

commit e2a87c08171acd5c3a037c1dd74a5504ff9cc881
Author:     William Carrel <william.a@carrel.org>
AuthorDate: 2025-10-30 18:39:29 +0000
Commit:     Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2025-11-03 23:27:19 +0000

    ifconfig.8: Mention max name length

    PR:             289113
    MFC after:      3 days

    (cherry picked from commit 832cd05905980d0f6547bf02745b054c1f4af1eb)

 sbin/ifconfig/ifconfig.8 | 3 +++
 1 file changed, 3 insertions(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-11-07 05:17:53 UTC
A commit in branch releng/15.0 references this bug:

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

commit 6efc9b0e6a6745425098e68e0f0cf375f3d1cb8e
Author:     William Carrel <william.a@carrel.org>
AuthorDate: 2025-10-30 18:39:29 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-11-07 04:19:16 +0000

    ifconfig.8: Mention max name length

    Approved by:    re (cperciva)
    PR:             289113
    MFC after:      3 days

    (cherry picked from commit 832cd05905980d0f6547bf02745b054c1f4af1eb)
    (cherry picked from commit e2a87c08171acd5c3a037c1dd74a5504ff9cc881)

 sbin/ifconfig/ifconfig.8 | 3 +++
 1 file changed, 3 insertions(+)
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2025-11-13 00:21:43 UTC
^Triage: committed and MFCed.