#include "iface.h"
#include "iface-linux.h"
+#ifndef IFLA_RTA
+#include <linux/if_addr.h>
+#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#endif
+
+#ifndef IFA_RTA
+#include <linux/if_addr.h>
+#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#endif
+
static int netlink_list_items(AvahiNetlink *nl, uint16_t type, unsigned *ret_seq) {
struct nlmsghdr *n;
struct rtgenmsg *gen;
(!m->server->config.use_iff_running || (ifinfomsg->ifi_flags & IFF_RUNNING)) &&
!(ifinfomsg->ifi_flags & IFF_LOOPBACK) &&
(ifinfomsg->ifi_flags & IFF_MULTICAST) &&
- !(ifinfomsg->ifi_flags & IFF_POINTOPOINT);
+ (m->server->config.allow_point_to_point || !(ifinfomsg->ifi_flags & IFF_POINTOPOINT));
/* Handle interface attributes */
l = NLMSG_PAYLOAD(n, sizeof(struct ifinfomsg));
/* Fill in hardware (MAC) address */
hw->mac_address_size = RTA_PAYLOAD(a);
- if (hw->mac_address_size > AVAHI_MAX_MAC_ADDRESS)
- hw->mac_address_size = AVAHI_MAX_MAC_ADDRESS;
+ if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX)
+ hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX;
memcpy(hw->mac_address, RTA_DATA(a), hw->mac_address_size);
break;
/* Let's handle netlink events until we are done with wild
* dumping */
- while (m->osdep.list != LIST_DONE) {
+ while (!m->list_complete)
if (!avahi_netlink_work(m->osdep.netlink, 1) == 0)
break;
- }
/* At this point Avahi knows about all local interfaces and
* addresses in existance. */