mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-07 10:00:07 +00:00
socket: Do not use AF_NETLINK in __opensock
It is not possible to use interface ioctls with netlink sockets
on all Linux kernels.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 3d981795cd
)
This commit is contained in:
parent
d8302ba2da
commit
6eaf10cbb7
@ -24,17 +24,10 @@
|
|||||||
int
|
int
|
||||||
__opensock (void)
|
__opensock (void)
|
||||||
{
|
{
|
||||||
/* SOCK_DGRAM is supported by all address families. (Netlink does
|
/* SOCK_DGRAM is supported by all address families. */
|
||||||
not support SOCK_STREAM.) */
|
|
||||||
int type = SOCK_DGRAM | SOCK_CLOEXEC;
|
int type = SOCK_DGRAM | SOCK_CLOEXEC;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
#ifdef AF_NETLINK
|
|
||||||
fd = __socket (AF_NETLINK, type, 0);
|
|
||||||
if (fd >= 0)
|
|
||||||
return fd;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fd = __socket (AF_UNIX, type, 0);
|
fd = __socket (AF_UNIX, type, 0);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
Loading…
Reference in New Issue
Block a user