[Bug 268397] /usr/share/examples/jails/jng script leaves broken network device behind

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 15 Dec 2022 17:07:21 UTC

            Bug ID: 268397
           Summary: /usr/share/examples/jails/jng script leaves broken
                    network device behind
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: simon@simonadameit.com

The "jng" script may leave a network device behind after removing a jail that
cannot be removed using neither `ifconfig` nor `ngctl`.

The behaviour was reproduced by jlduran:

In the following logs `ng0_workstation` is the leftover device when the jail
was shutdown. When using ifconfig the following error is shown:

# ifconfig
ng0_workstation: flags=208842<BROADCAST,RUNNING,SIMPLEX,MULTICAST>
        ether 02:5a:1b:8e:8a:c7
ifconfig: ioctl(SIOCGIFINFO_IN6): Device not configured

When trying to remove the interface using ifconfig:
 # ifconfig ng0_workstation destroy
ifconfig: ioctl (SIOCGIFFLAGS): no such interface

When trying to get the status using `ngctl`:
 # ngctl status ng0_workstation:
No status available for "ng0_workstation:"

You are receiving this mail because:
You are the assignee for the bug.