[Sumover-dev] [svn commit] r3901 - common/trunk/src

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu Oct 19 16:21:09 BST 2006


Author: csp
Date: Thu Oct 19 16:21:06 2006
New Revision: 3901

Modified:
   common/trunk/src/net_udp.c

Log:
Set the TTL for unicast connections, rather than relying on the default.


Modified: common/trunk/src/net_udp.c
==============================================================================
--- common/trunk/src/net_udp.c	(original)
+++ common/trunk/src/net_udp.c	Thu Oct 19 16:21:06 2006
@@ -344,7 +344,13 @@
 				return NULL;
 			}
 		}
+	} else {
+		if (SETSOCKOPT(s->fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) != 0) {
+			socket_error("setsockopt IP_TTL");
+			return NULL;
+		}
 	}
+
         s->addr = strdup(addr);
 	return s;
 }
@@ -530,6 +536,11 @@
 			socket_error("setsockopt IPV6_MULTICAST_HOPS");
 			return NULL;
 		}
+	} else {
+		if (SETSOCKOPT(s->fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) != 0) {
+			socket_error("setsockopt IP_TTL");
+			return NULL;
+		}
 	}
 
 	assert(s != NULL);



More information about the Sumover-dev mailing list