linux(4): Add a counterpart to linux_ifflags
For further use in linux_ioctl_socket add bsd_to_linux_ifflags() which accepts FreeBSD interface flags and translate it to Linux if flags. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D38873
This commit is contained in:
parent
945a7f0d21
commit
5c32488de0
@ -434,10 +434,17 @@ ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname)
|
||||
unsigned short
|
||||
linux_ifflags(struct ifnet *ifp)
|
||||
{
|
||||
unsigned short fl, flags;
|
||||
unsigned short flags;
|
||||
|
||||
flags = if_getflags(ifp) | if_getdrvflags(ifp);
|
||||
return (bsd_to_linux_ifflags(flags));
|
||||
}
|
||||
|
||||
unsigned short
|
||||
bsd_to_linux_ifflags(int fl)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
|
||||
fl = (if_getflags(ifp) | if_getdrvflags(ifp)) & 0xffff;
|
||||
flags = 0;
|
||||
if (fl & IFF_UP)
|
||||
flags |= LINUX_IFF_UP;
|
||||
if (fl & IFF_BROADCAST)
|
||||
|
@ -39,6 +39,7 @@ int ifname_linux_to_bsd(struct thread *, const char *, char *);
|
||||
unsigned short linux_ifflags(struct ifnet *);
|
||||
int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa);
|
||||
|
||||
unsigned short bsd_to_linux_ifflags(int);
|
||||
int linux_to_bsd_domain(int domain);
|
||||
int bsd_to_linux_domain(int domain);
|
||||
int bsd_to_linux_sockaddr(const struct sockaddr *sa,
|
||||
|
Loading…
Reference in New Issue
Block a user