Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102198466
D38830.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D38830.diff
View Options
diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c
--- a/sys/compat/linsysfs/linsysfs.c
+++ b/sys/compat/linsysfs/linsysfs.c
@@ -98,13 +98,11 @@
linsysfs_ifnet_flags(PFS_FILL_ARGS)
{
struct ifnet *ifp;
- unsigned short flags;
ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL);
if (ifp == NULL)
return (ENOENT);
- linux_ifflags(ifp, &flags);
- sbuf_printf(sb, "0x%x\n", flags);
+ sbuf_printf(sb, "0x%x\n", linux_ifflags(ifp));
return (0);
}
diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c
--- a/sys/compat/linux/linux.c
+++ b/sys/compat/linux/linux.c
@@ -416,33 +416,34 @@
return (arg.ifp);
}
-void
-linux_ifflags(struct ifnet *ifp, short *flags)
+unsigned short
+linux_ifflags(struct ifnet *ifp)
{
- unsigned short fl;
+ unsigned short fl, flags;
fl = (if_getflags(ifp) | if_getdrvflags(ifp)) & 0xffff;
- *flags = 0;
+ flags = 0;
if (fl & IFF_UP)
- *flags |= LINUX_IFF_UP;
+ flags |= LINUX_IFF_UP;
if (fl & IFF_BROADCAST)
- *flags |= LINUX_IFF_BROADCAST;
+ flags |= LINUX_IFF_BROADCAST;
if (fl & IFF_DEBUG)
- *flags |= LINUX_IFF_DEBUG;
+ flags |= LINUX_IFF_DEBUG;
if (fl & IFF_LOOPBACK)
- *flags |= LINUX_IFF_LOOPBACK;
+ flags |= LINUX_IFF_LOOPBACK;
if (fl & IFF_POINTOPOINT)
- *flags |= LINUX_IFF_POINTOPOINT;
+ flags |= LINUX_IFF_POINTOPOINT;
if (fl & IFF_DRV_RUNNING)
- *flags |= LINUX_IFF_RUNNING;
+ flags |= LINUX_IFF_RUNNING;
if (fl & IFF_NOARP)
- *flags |= LINUX_IFF_NOARP;
+ flags |= LINUX_IFF_NOARP;
if (fl & IFF_PROMISC)
- *flags |= LINUX_IFF_PROMISC;
+ flags |= LINUX_IFF_PROMISC;
if (fl & IFF_ALLMULTI)
- *flags |= LINUX_IFF_ALLMULTI;
+ flags |= LINUX_IFF_ALLMULTI;
if (fl & IFF_MULTICAST)
- *flags |= LINUX_IFF_MULTICAST;
+ flags |= LINUX_IFF_MULTICAST;
+ return (flags);
}
static u_int
diff --git a/sys/compat/linux/linux_common.h b/sys/compat/linux/linux_common.h
--- a/sys/compat/linux/linux_common.h
+++ b/sys/compat/linux/linux_common.h
@@ -36,7 +36,7 @@
struct ifnet *ifname_linux_to_bsd(struct thread *td,
const char *lxname, char *bsdname);
-void linux_ifflags(struct ifnet *ifp, short *flags);
+unsigned short linux_ifflags(struct ifnet *);
int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa);
int linux_to_bsd_domain(int domain);
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -2237,9 +2237,9 @@
static int
linux_gifflags(struct thread *td, struct ifnet *ifp, struct l_ifreq *ifr)
{
- l_short flags;
+ unsigned short flags;
- linux_ifflags(ifp, &flags);
+ flags = linux_ifflags(ifp);
return (copyout(&flags, &ifr->ifr_flags, sizeof(flags)));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 8:35 PM (18 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14565426
Default Alt Text
D38830.diff (2 KB)
Attached To
Mode
D38830: linux(4): Make linux_ifflags return a value
Attached
Detach File
Event Timeline
Log In to Comment