File ntp-sntp-recverr.patch of Package ntp.500

Index: sntp/networking.c
===================================================================
--- sntp/networking.c.orig	2010-11-28 05:31:26.000000000 +0100
+++ sntp/networking.c	2014-02-14 12:33:07.844985648 +0100
@@ -85,6 +85,17 @@
 
 	if (-1 == *rsock && ENABLED_OPT(NORMALVERBOSE))
 		printf("Failed to create UDP socket with family %d\n", AF(dest));
+#ifdef IP_RECVERR
+	else {
+		int btrue = 1;
+#ifdef IP6_RECVERR
+		if (AF(dest) == AF_INET6) 
+			setsockopt(*rsock, IPPROTO_IPV6, IPV6_RECVERR, &btrue, sizeof(btrue));
+		else
+#endif
+			setsockopt(*rsock, IPPROTO_IP, IP_RECVERR, &btrue, sizeof(btrue));
+	}
+#endif
 }
 
 /* Send a packet */
openSUSE Build Service is sponsored by