commit: r522 - in trunk/libspread-util: . include src
[email protected] Thu, 03 May 2012 12:21:59 -0400
| Newsgroups | gmane.network.spread.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: jonathan Date: 2012-05-03 12:21:58 -0400 (Thu, 03 May 2012) New Revision: 522 Modified: trunk/libspread-util/Changelog trunk/libspread-util/include/spu_data_link.h trunk/libspread-util/src/data_link.c Log: Update libspread-util to beta3 with new DL_init_channel option for DL_BIND_ALL Modified: trunk/libspread-util/Changelog =================================================================== --- trunk/libspread-util/Changelog 2012-05-03 16:07:31 UTC (rev 521) +++ trunk/libspread-util/Changelog 2012-05-03 16:21:58 UTC (rev 522) @@ -1,3 +1,13 @@ +2012-05-02 Jonathan Stanton <[email protected]> + + * src/data_link.c (DL_init_channel): The version of data_link.c's DL_init_channel function has + changed semantics from the version previously used by Spread. When you create a channel with a + multicast address, it will now only bind that socket to the multicast address not to INADDR_ANY. + This is needed for some uses of datalink (like in Spines) but is the wrong semantics if you want + one socket to receive both multicast and unicast traffic sent to the same port. So to support that + semantics a new channel_type modifier was added to the API DL_BIND_ALL which when passed in will force + the bind to be to INADDR_ANY unless a specific interface address was provided. + Tue Mar 20 17:57:44 2012 Jonathan Stanton <[email protected]> * configure.in: Make use of dladdr in the function name lookup code a compile time option so Modified: trunk/libspread-util/include/spu_data_link.h =================================================================== --- trunk/libspread-util/include/spu_data_link.h 2012-05-03 16:07:31 UTC (rev 521) +++ trunk/libspread-util/include/spu_data_link.h 2012-05-03 16:21:58 UTC (rev 522) @@ -45,6 +45,7 @@ #define RECV_CHANNEL 0x00000002 #define NO_LOOP 0x00000004 #define REUSE_ADDR 0x00000008 +#define DL_BIND_ALL 0x00000010 #define IS_MCAST_ADDR(addr) ( ( (addr) & 0xF0000000 ) == 0xE0000000 ) #define IS_MCAST_ADDR_NET(addr) ( ( (unsigned char*) &(addr) )[0] == 0xE0 ) Modified: trunk/libspread-util/src/data_link.c =================================================================== --- trunk/libspread-util/src/data_link.c 2012-05-03 16:07:31 UTC (rev 521) +++ trunk/libspread-util/src/data_link.c 2012-05-03 16:21:58 UTC (rev 522) @@ -105,7 +105,7 @@ /* If mcast channel, the interface means the interface to receive mcast packets on, and not interface to bind. Must bind multicast address instead */ - if (mcast_address != 0) + if (mcast_address != 0 && IS_MCAST_ADDR(mcast_address) && !(channel_type & DL_BIND_ALL) ) soc_addr.sin_addr.s_addr= htonl(mcast_address); else if (interface_address != 0) soc_addr.sin_addr.s_addr= htonl(interface_address);