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:
parent
0c761ee78d
commit
6e3cb00068
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216267
@ -295,8 +295,6 @@ main(int argc, char *argv[])
|
|||||||
sdl = (const struct sockaddr_dl *) ifa->ifa_addr;
|
sdl = (const struct sockaddr_dl *) ifa->ifa_addr;
|
||||||
else
|
else
|
||||||
sdl = NULL;
|
sdl = NULL;
|
||||||
if (sdl != NULL && sdl->sdl_type == IFT_USB)
|
|
||||||
continue;
|
|
||||||
if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly)
|
if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly)
|
||||||
continue;
|
continue;
|
||||||
iflen = strlcpy(name, ifa->ifa_name, sizeof(name));
|
iflen = strlcpy(name, ifa->ifa_name, sizeof(name));
|
||||||
@ -307,6 +305,8 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
cp = ifa->ifa_name;
|
cp = ifa->ifa_name;
|
||||||
|
|
||||||
|
if ((ifa->ifa_flags & IFF_CANTCONFIG) != 0)
|
||||||
|
continue;
|
||||||
if (downonly && (ifa->ifa_flags & IFF_UP) != 0)
|
if (downonly && (ifa->ifa_flags & IFF_UP) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (uponly && (ifa->ifa_flags & IFF_UP) == 0)
|
if (uponly && (ifa->ifa_flags & IFF_UP) == 0)
|
||||||
|
@ -64,6 +64,7 @@ usbpf_attach(struct usb_bus *ubus)
|
|||||||
|
|
||||||
ifp = ubus->ifp = if_alloc(IFT_USB);
|
ifp = ubus->ifp = if_alloc(IFT_USB);
|
||||||
if_initname(ifp, "usbus", device_get_unit(ubus->bdev));
|
if_initname(ifp, "usbus", device_get_unit(ubus->bdev));
|
||||||
|
ifp->if_flags = IFF_CANTCONFIG;
|
||||||
if_attach(ifp);
|
if_attach(ifp);
|
||||||
if_up(ifp);
|
if_up(ifp);
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ struct if_data {
|
|||||||
#define IFF_LINK2 0x4000 /* per link layer defined bit */
|
#define IFF_LINK2 0x4000 /* per link layer defined bit */
|
||||||
#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
|
#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
|
||||||
#define IFF_MULTICAST 0x8000 /* (i) supports multicast */
|
#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_PPROMISC 0x20000 /* (n) user-requested promisc mode */
|
||||||
#define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */
|
#define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */
|
||||||
#define IFF_STATICARP 0x80000 /* (n) static ARP */
|
#define IFF_STATICARP 0x80000 /* (n) static ARP */
|
||||||
|
Loading…
Reference in New Issue
Block a user