Lines Matching refs:netlinkfd
54 if ((daemon->netlinkfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) != -1) in netlink_init()
56 if (bind(daemon->netlinkfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) in netlink_init()
59 if (errno != EPERM || bind(daemon->netlinkfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) in netlink_init()
60 daemon->netlinkfd = -1; in netlink_init()
64 if (daemon->netlinkfd == -1 || in netlink_init()
65 getsockname(daemon->netlinkfd, (struct sockaddr *)&addr, &slen) == 1) in netlink_init()
91 while ((rc = recvmsg(daemon->netlinkfd, &msg, MSG_PEEK | MSG_TRUNC)) == -1 && errno == EINTR); in netlink_recv()
108 while ((rc = recvmsg(daemon->netlinkfd, &msg, 0)) == -1 && errno == EINTR); in netlink_recv()
152 while((len = sendto(daemon->netlinkfd, (void *)&req, sizeof(req), 0, in iface_enumerate()
243 if ((flags = fcntl(daemon->netlinkfd, F_GETFL)) == -1 || in netlink_multicast()
244 fcntl(daemon->netlinkfd, F_SETFL, flags | O_NONBLOCK) == -1) in netlink_multicast()
257 fcntl(daemon->netlinkfd, F_SETFL, flags); in netlink_multicast()