Introduces IFF_CANTCONFIG interface flag to point that the interface

isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by:	brooks
No objections:	gavin, jkim
This commit is contained in:
Weongyo Jeong 2010-12-07 20:23:47 +00:00
parent 0c761ee78d
commit 6e3cb00068
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216267
3 changed files with 4 additions and 3 deletions

View File

@ -295,8 +295,6 @@ main(int argc, char *argv[])
sdl = (const struct sockaddr_dl *) ifa->ifa_addr;
else
sdl = NULL;
if (sdl != NULL && sdl->sdl_type == IFT_USB)
continue;
if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly)
continue;
iflen = strlcpy(name, ifa->ifa_name, sizeof(name));
@ -307,6 +305,8 @@ main(int argc, char *argv[])
}
cp = ifa->ifa_name;
if ((ifa->ifa_flags & IFF_CANTCONFIG) != 0)
continue;
if (downonly && (ifa->ifa_flags & IFF_UP) != 0)
continue;
if (uponly && (ifa->ifa_flags & IFF_UP) == 0)

View File

@ -64,6 +64,7 @@ usbpf_attach(struct usb_bus *ubus)
ifp = ubus->ifp = if_alloc(IFT_USB);
if_initname(ifp, "usbus", device_get_unit(ubus->bdev));
ifp->if_flags = IFF_CANTCONFIG;
if_attach(ifp);
if_up(ifp);

View File

@ -145,7 +145,7 @@ struct if_data {
#define IFF_LINK2 0x4000 /* per link layer defined bit */
#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
#define IFF_MULTICAST 0x8000 /* (i) supports multicast */
/* 0x10000 */
#define IFF_CANTCONFIG 0x10000 /* (i) unconfigurable using ioctl(2) */
#define IFF_PPROMISC 0x20000 /* (n) user-requested promisc mode */
#define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */
#define IFF_STATICARP 0x80000 /* (n) static ARP */