Bug 270618 - ifconfig: BRDGADD epair0a: Device not configured
Summary: ifconfig: BRDGADD epair0a: Device not configured
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Zhenlei Huang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-03 08:57 UTC by Zhenlei Huang
Modified: 2023-04-10 06:14 UTC (History)
1 user (show)

See Also:
zlei: mfc-stable13+
zlei: mfc-stable12+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenlei Huang freebsd_committer freebsd_triage 2023-04-03 08:57:54 UTC
While repeating https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270607 I encountered this interesting bug again. Its first occurrence is when I was doing https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270417 . 

When clone creating if_bridge(4), ifconfig will fail with `Device not configured` if the device unit number of bridge is not provided.

Scripts to repeat:

```
#!/bin/sh

ep=$( ifconfig epair create )
br=$( ifconfig bridge create addm $ep )

ifconfig $br destroy
ifconfig $ep destroy
```
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-04-07 14:27:24 UTC
A commit in branch main references this bug:

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

commit 09e5e3d598604167c1fb05e5cd0f41ed83314517
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-04-07 14:25:41 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-04-07 14:25:41 +0000

    ifconfig: Fix configuring if_bridge with additional operating parameters

    For clone create and rename operations, the interface name get back can be
    different from the one passed to ioctl(). Use the interface name we get back
    so that ifconfig will not return unexpected ENXIO.

    PR:             270618
    Reviewed by:    kp
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39396

 sbin/ifconfig/ifbridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-10 04:17:16 UTC
A commit in branch stable/13 references this bug:

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

commit bab5ce8deafb00683fb8319208750981e68d309c
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-04-07 14:25:41 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-04-10 04:15:05 +0000

    ifconfig: Fix configuring if_bridge with additional operating parameters

    For clone create and rename operations, the interface name get back can be
    different from the one passed to ioctl(). Use the interface name we get back
    so that ifconfig will not return unexpected ENXIO.

    PR:             270618
    Reviewed by:    kp
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39396

    (cherry picked from commit 09e5e3d598604167c1fb05e5cd0f41ed83314517)

 sbin/ifconfig/ifbridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-04-10 05:08:20 UTC
A commit in branch stable/12 references this bug:

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

commit 59f3510ea793d35fbf2996087af5ab870cc0229f
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-04-07 14:25:41 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-04-10 05:06:22 +0000

    ifconfig: Fix configuring if_bridge with additional operating parameters

    For clone create and rename operations, the interface name get back can be
    different from the one passed to ioctl(). Use the interface name we get back
    so that ifconfig will not return unexpected ENXIO.

    PR:             270618
    Reviewed by:    kp
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39396

    (cherry picked from commit 09e5e3d598604167c1fb05e5cd0f41ed83314517)
    (cherry picked from commit bab5ce8deafb00683fb8319208750981e68d309c)

 sbin/ifconfig/ifbridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)