From af50ea380f6d56a33720eee1fd8b16e0766833c8 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 5 Nov 2013 12:52:56 +0000 Subject: [PATCH] Axe IFF_SMART. Fortunately this layering violating flag was never used, it was just declared. --- share/man/man9/ifnet.9 | 10 +--------- sys/compat/linux/linux_ioctl.c | 2 +- sys/net/if.c | 4 +--- sys/net/if.h | 4 ++-- usr.sbin/route6d/route6d.c | 3 --- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9 index 17b114c4a01d..f1d3e471bc6a 100644 --- a/share/man/man9/ifnet.9 +++ b/share/man/man9/ifnet.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2013 +.Dd November 5, 2013 .Dt IFNET 9 .Os .Sh NAME @@ -583,14 +583,6 @@ The interface is a loopback device. The interface is point-to-point; .Dq broadcast address is actually the address of the other end. -.It Dv IFF_SMART -.Aq S* -The interface manages its own routes, rather than using the generic -code in -.Fn if_up -and -.Fn if_down . -This is probably useful for serial lines. .It Dv IFF_DRV_RUNNING .Aq D* The interface has been configured and dynamic resources were diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 0600f91221a1..48afc09897bd 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2287,7 +2287,7 @@ linux_gifflags(struct thread *td, struct ifnet *ifp, struct l_ifreq *ifr) flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; /* these flags have no Linux equivalent */ - flags &= ~(IFF_SMART|IFF_DRV_OACTIVE|IFF_SIMPLEX| + flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| IFF_LINK0|IFF_LINK1|IFF_LINK2); /* Linux' multicast flag is in a different bit */ if (flags & IFF_MULTICAST) { diff --git a/sys/net/if.c b/sys/net/if.c index 03683f67aef5..0c36b4f8ac09 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2210,9 +2210,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) */ new_flags = (ifr->ifr_flags & 0xffff) | (ifr->ifr_flagshigh << 16); - if (ifp->if_flags & IFF_SMART) { - /* Smart drivers twiddle their own routes */ - } else if (ifp->if_flags & IFF_UP && + if (ifp->if_flags & IFF_UP && (new_flags & IFF_UP) == 0) { if_down(ifp); } else if (new_flags & IFF_UP && diff --git a/sys/net/if.h b/sys/net/if.h index 83c65b8097c0..cb101d2af30c 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -129,7 +129,7 @@ struct if_data { #define IFF_DEBUG 0x4 /* (n) turn on debugging */ #define IFF_LOOPBACK 0x8 /* (i) is a loopback net */ #define IFF_POINTOPOINT 0x10 /* (i) is a point-to-point link */ -#define IFF_SMART 0x20 /* (i) interface manages own routes */ +/* 0x20 was IFF_SMART */ #define IFF_DRV_RUNNING 0x40 /* (d) resources allocated */ #define IFF_NOARP 0x80 /* (n) no address resolution protocol */ #define IFF_PROMISC 0x100 /* (n) receive all packets */ @@ -159,7 +159,7 @@ struct if_data { /* flags set internally only: */ #define IFF_CANTCHANGE \ (IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\ - IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\ + IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_PROMISC|\ IFF_DYING|IFF_CANTCONFIG) /* diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index 421ac1ae09dd..94fb3aec6429 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -2584,9 +2584,6 @@ do { \ IFFLAG("POINTOPOINT", IFF_POINTOPOINT); #ifdef IFF_NOTRAILERS IFFLAG("NOTRAILERS", IFF_NOTRAILERS); -#endif -#ifdef IFF_SMART - IFFLAG("SMART", IFF_SMART); #endif IFFLAG("RUNNING", IFF_RUNNING); IFFLAG("NOARP", IFF_NOARP);