X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fiface-pfroute.c;h=a7ecdc95c57e010f12c7640a4153176b92724aa5;hb=9aa4773acbfadbcf95aaf0063510f8be8ddcbd86;hp=f2401e9475c34fcdc4da6d36597de4ca421a83c4;hpb=59395d1f90286156626bdb8df70752b7d169a9ce;p=catta diff --git a/avahi-core/iface-pfroute.c b/avahi-core/iface-pfroute.c index f2401e9..a7ecdc9 100644 --- a/avahi-core/iface-pfroute.c +++ b/avahi-core/iface-pfroute.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -87,8 +88,8 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m) hw->mtu = ifm->ifm_data.ifi_mtu; hw->mac_address_size = sdl->sdl_alen; - 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, sdl->sdl_data + sdl->sdl_nlen, hw->mac_address_size); @@ -118,6 +119,11 @@ static void rtm_addr(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m) int prefixlen = 0; struct sockaddr *sa =NULL; +#ifdef __NetBSD__ + if(((struct sockaddr *)cp)->sa_family == AF_UNSPEC) + ((struct sockaddr *)cp)->sa_family = AF_INET; +#endif + if(((struct sockaddr *)cp)->sa_family != AF_INET && ((struct sockaddr *)cp)->sa_family != AF_INET6) return;