Page MenuHomeFreeBSD

D20146.1794839369.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D20146.1794839369.diff

Index: head/sys/compat/linux/linux.h
===================================================================
--- head/sys/compat/linux/linux.h
+++ head/sys/compat/linux/linux.h
@@ -46,6 +46,26 @@
#define LINUX_ARPHRD_ETHER 1
#define LINUX_ARPHRD_LOOPBACK 772
+/*
+ * net device flags
+ */
+#define LINUX_IFF_UP 0x0001
+#define LINUX_IFF_BROADCAST 0x0002
+#define LINUX_IFF_DEBUG 0x0004
+#define LINUX_IFF_LOOPBACK 0x0008
+#define LINUX_IFF_POINTOPOINT 0x0010
+#define LINUX_IFF_NOTRAILERS 0x0020
+#define LINUX_IFF_RUNNING 0x0040
+#define LINUX_IFF_NOARP 0x0080
+#define LINUX_IFF_PROMISC 0x0100
+#define LINUX_IFF_ALLMULTI 0x0200
+#define LINUX_IFF_MASTER 0x0400
+#define LINUX_IFF_SLAVE 0x0800
+#define LINUX_IFF_MULTICAST 0x1000
+#define LINUX_IFF_PORTSEL 0x2000
+#define LINUX_IFF_AUTOMEDIA 0x4000
+#define LINUX_IFF_DYNAMIC 0x8000
+
/* sigaltstack */
#define LINUX_SS_ONSTACK 1
#define LINUX_SS_DISABLE 2
Index: head/sys/compat/linux/linux.c
===================================================================
--- head/sys/compat/linux/linux.c
+++ head/sys/compat/linux/linux.c
@@ -269,16 +269,30 @@
void
linux_ifflags(struct ifnet *ifp, short *flags)
{
+ unsigned short fl;
- *flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff;
- /* these flags have no Linux equivalent */
- *flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX|
- IFF_LINK0|IFF_LINK1|IFF_LINK2);
- /* Linux' multicast flag is in a different bit */
- if (*flags & IFF_MULTICAST) {
- *flags &= ~IFF_MULTICAST;
- *flags |= 0x1000;
- }
+ fl = (ifp->if_flags | ifp->if_drv_flags) & 0xffff;
+ *flags = 0;
+ if (fl & IFF_UP)
+ *flags |= LINUX_IFF_UP;
+ if (fl & IFF_BROADCAST)
+ *flags |= LINUX_IFF_BROADCAST;
+ if (fl & IFF_DEBUG)
+ *flags |= LINUX_IFF_DEBUG;
+ if (fl & IFF_LOOPBACK)
+ *flags |= LINUX_IFF_LOOPBACK;
+ if (fl & IFF_POINTOPOINT)
+ *flags |= LINUX_IFF_POINTOPOINT;
+ if (fl & IFF_DRV_RUNNING)
+ *flags |= LINUX_IFF_RUNNING;
+ if (fl & IFF_NOARP)
+ *flags |= LINUX_IFF_NOARP;
+ if (fl & IFF_PROMISC)
+ *flags |= LINUX_IFF_PROMISC;
+ if (fl & IFF_ALLMULTI)
+ *flags |= LINUX_IFF_ALLMULTI;
+ if (fl & IFF_MULTICAST)
+ *flags |= LINUX_IFF_MULTICAST;
}
int

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 16, 2:29 PM (22 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41781988
Default Alt Text
D20146.1794839369.diff (2 KB)

Event Timeline