blob: 216349d26fbbe203149049f0dfe98d4bea399df5 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001Patch originally from Fedora
2
3http://pkgs.fedoraproject.org/cgit/tftp.git/
4
5Upstream-Status: Pending
6
7diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c
8--- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100
9+++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100
10@@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un
11
12 /* Try to enable getting the return address */
13 #ifdef IP_RECVDSTADDR
14- if (from->sa_family == AF_INET)
15+ if (from->sa_family == AF_INET || !from->sa_family)
16 setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
17 #endif
18 #ifdef IP_PKTINFO
19- if (from->sa_family == AF_INET)
20+ if (from->sa_family == AF_INET || !from->sa_family)
21 setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
22 #endif
23 #ifdef HAVE_IPV6
24 #ifdef IPV6_RECVPKTINFO
25- if (from->sa_family == AF_INET6)
26+ if (from->sa_family == AF_INET6 || !from->sa_family)
27 setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
28 #endif
29 #endif