clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-hpa-5.2-pktinfo.patch

10665a
diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c
10665a
--- tftp-hpa-5.2/tftpd/recvfrom.c.test	2011-12-11 23:13:52.000000000 +0100
10665a
+++ tftp-hpa-5.2/tftpd/recvfrom.c	2012-01-04 10:05:17.852042256 +0100
10665a
@@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un
10665a
 
10665a
     /* Try to enable getting the return address */
10665a
 #ifdef IP_RECVDSTADDR
10665a
-    if (from->sa_family == AF_INET)
10665a
+    if (from->sa_family == AF_INET || !from->sa_family)
10665a
         setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
10665a
 #endif
10665a
 #ifdef IP_PKTINFO
10665a
-    if (from->sa_family == AF_INET)
10665a
+    if (from->sa_family == AF_INET || !from->sa_family)
10665a
         setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
10665a
 #endif
10665a
 #ifdef HAVE_IPV6
10665a
 #ifdef IPV6_RECVPKTINFO
10665a
-    if (from->sa_family == AF_INET6)
10665a
+    if (from->sa_family == AF_INET6 || !from->sa_family)
10665a
         setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
10665a
 #endif
10665a
 #endif