X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fiface-linux.c;h=c8ed9e05c6e913a58b7a9e9c30f4690b4c513a05;hb=1f42fa6815e3de2ca7cd136c7709584c977b3640;hp=4fc4addfd49cf6e37f4e48314a7f891ae6765ee3;hpb=71cb9656e633111a127779af5923780620792e0b;p=catta diff --git a/avahi-core/iface-linux.c b/avahi-core/iface-linux.c index 4fc4add..c8ed9e0 100644 --- a/avahi-core/iface-linux.c +++ b/avahi-core/iface-linux.c @@ -34,6 +34,16 @@ #include "iface.h" #include "iface-linux.h" +#ifndef IFLA_RTA +#include +#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) +#endif + +#ifndef IFA_RTA +#include +#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; @@ -98,7 +108,7 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat (!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)); @@ -124,8 +134,8 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat /* 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;