On Thu, 2006-03-30 at 15:13 +0100, Alexander Clouter wrote:
Hi,
After my earlier multicast patch I quickly realised that if syslog-ng is actually sending UDP multicast syslog data the TTL on the IP packets is by default 1. This results in the packet being expired at the gateway and never being able to leave the subnet....not too handy :(
I have now implemented generic socket option setup code and support for TTL and multicast. The patch below does that. It has no real connection to the code that you posted, as I tried to minimize the effect on GSockAddr, as it encapsulates a socket address but nothing else. I also added support for some long awaited socket options like SO_RCVBUF and SO_SNDBUF, but broadcast support was also added. Sending seems to work well, I have not tested receive and IPv6 support. Documentation is not yet updated, these are the new keywords to be applied to various socket drivers (unix-dgram, unix-stream, udp, tcp, udp6 and tcp6): --- orig/src/cfg-lex.l +++ mod/src/cfg-lex.l @@ -117,6 +117,12 @@ static struct keyword keywords[] = { { "localport", KW_LOCALPORT }, { "port", KW_PORT }, { "destport", KW_DESTPORT }, + { "ip_ttl", KW_IP_TTL }, + { "ip_tos", KW_IP_TOS }, + { "so_broadcast", KW_SO_BROADCAST }, + { "so_rcvbuf", KW_SO_RCVBUF }, + { "so_sndbuf", KW_SO_SNDBUF }, + { "owner", KW_OWNER }, { "group", KW_GROUP }, { "perm", KW_PERM }, Multicast is enabled if the bind/target address is a multicast address. -- Bazsi