tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

IP_PKTINFO in NetBSD-current



A few days ago NetBSD-current gained support for the IP_PKTINFO api.
Unfortunately there are two of those, one that linux uses, one that everyone
else uses.

Now pkgs begin to pick this up in autoconf (I hope not many, as realy few
should care about low level routing details), and unsuprisingly many are
only tested on Linux, or so it seems.

I ran into it with net/avahi and needed the attached patch.

Another option, of course, is to change their autoconf test for the API to
explicitly use the differently named field and disable IP_PKTINFO on != linux,
or the right fix: autoconf test for both variants of the api and use the
right one.

Martin
--- avahi-core/socket.c.orig    2011-04-25 02:12:18.000000000 +0200
+++ avahi-core/socket.c 2013-06-30 11:40:00.000000000 +0200
@@ -528,7 +528,11 @@
             pkti->ipi_ifindex = interface;
 
         if (src_address)
+#ifdef __linux__
             pkti->ipi_spec_dst.s_addr = src_address->address;
+#else
+            pkti->ipi_addr.s_addr = src_address->address;
+#endif
     }
 #elif defined(IP_MULTICAST_IF)
     if (src_address) {


Home | Main Index | Thread Index | Old Index