atftp, bump version (#7413)

This commit is contained in:
Schrijvers Luc
2022-11-14 12:08:46 +01:00
committed by GitHub
parent 18bd172126
commit e126bed6de
2 changed files with 46 additions and 40 deletions

View File

@@ -3,11 +3,11 @@ DESCRIPTION="atftp is a client/server implementation of the TFTP protocol \
that implements RFCs 1350, 2090, 2347, 2348, and 2349. The server is \
multi-threaded and the client presents a friendly interface using libreadline."
HOMEPAGE="https://sourceforge.net/projects/atftp/"
COPYRIGHT="2000-2021 Jean-Pierre Lefebvre & Remi Lefebvre"
COPYRIGHT="2000-2022 Jean-Pierre Lefebvre & Remi Lefebvre"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://sourceforge.net/projects/atftp/files/atftp-$portVersion.tar.gz"
CHECKSUM_SHA256="d3c9cd0d971dfc786d7a5f4055c35d4e66aafc8102ac03473ef225bdf7edb26a"
CHECKSUM_SHA256="df2aa089c7670f9eab40e5598e5d2cb6a582dc5182926ea50b4d690e4e37f316"
SOURCE_FILENAME="atftp-$portVersion.tar.gz"
PATCHES="atftp-$portVersion.patchset"
@@ -30,35 +30,37 @@ PROVIDES="
REQUIRES="
haiku$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libpcre$secondaryArchSuffix
lib:libpcre2_8$secondaryArchSuffix
lib:libreadline$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncurses$secondaryArchSuffix
devel:libpcre$secondaryArchSuffix
devel:libpcre2_8$secondaryArchSuffix
devel:libreadline$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autoheader
cmd:automake
cmd:awk
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:make
"
PATCH()
{
sed -i "s/-lpthread/-lroot/g" configure
}
BUILD()
{
export LDFLAGS="-lnetwork -lbsd"
export CPPFLAGS="-D_BSD_SOURCE"
./autogen.sh
runConfigure --omit-dirs "binDir sbinDir" ./configure \
--bindir=$commandBinDir \
--sbindir=$commandBinDir
--sbindir=$commandBinDir \
--enable-readline \
--enable-libpcre
make $jobArgs
}
@@ -66,3 +68,8 @@ INSTALL()
{
make install
}
TEST()
{
make check
}

View File

@@ -5,25 +5,24 @@ Subject: [PATCH] Merging Axel's patches from trunk.
diff --git a/logger.c b/logger.c
index 2ef1ba3..0d47c4a 100644
index b9243b1..742b6d4 100644
--- a/logger.c
+++ b/logger.c
@@ -20,7 +20,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
-#include <sys/stat.h>
+#ifndef __HAIKU__
+ #include <sys/stat.h>
#include <sys/stat.h>
+#endif
#include <fcntl.h>
#include <stdarg.h>
#include <string.h>
diff --git a/tftp_def.c b/tftp_def.c
index 428a930..f9286f0 100644
index fd60bae..982ee4b 100644
--- a/tftp_def.c
+++ b/tftp_def.c
@@ -151,7 +151,6 @@ int Gethostbyname(char *addr, struct hostent *host)
@@ -152,7 +152,6 @@ int Gethostbyname(char *addr, struct hostent *host)
struct hostent *hp;
char *tmpbuf;
size_t tmpbuflen;
@@ -31,7 +30,7 @@ index 428a930..f9286f0 100644
int herr;
tmpbuflen = 1024;
@@ -159,12 +158,12 @@ int Gethostbyname(char *addr, struct hostent *host)
@@ -160,12 +159,12 @@ int Gethostbyname(char *addr, struct hostent *host)
if ((tmpbuf = (char *)malloc(tmpbuflen)) == NULL)
return ERR;
@@ -42,12 +41,12 @@ index 428a930..f9286f0 100644
/* Check for errors. */
- if (res != 0)
+ if (hp == NULL)
+ if (hp != 0)
{
logger(LOG_ERR, "%s: %d: gethostbyname_r: %s",
__FILE__, __LINE__, strerror(herr));
diff --git a/tftp_io.c b/tftp_io.c
index a0c702e..abae85d 100644
index 1487e89..6157936 100644
--- a/tftp_io.c
+++ b/tftp_io.c
@@ -217,8 +217,6 @@ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa
@@ -59,7 +58,7 @@ index a0c702e..abae85d 100644
struct iovec iov;
char cbuf[1024];
@@ -288,11 +286,13 @@ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa
@@ -289,11 +287,13 @@ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa
cmsg != NULL && cmsg->cmsg_len >= sizeof(*cmsg);
cmsg = CMSG_NXTHDR(&msg, cmsg))
{
@@ -74,7 +73,7 @@ index a0c702e..abae85d 100644
sa_to->ss_family = AF_INET;
((struct sockaddr_in *)sa_to)->sin_addr =
pktinfo4->ipi_addr;
@@ -302,11 +302,20 @@ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa
@@ -303,11 +303,20 @@ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa
if (cmsg->cmsg_level == SOL_IPV6
&& cmsg->cmsg_type == IPV6_PKTINFO)
{
@@ -97,16 +96,16 @@ index a0c702e..abae85d 100644
break;
}
diff --git a/tftpd.c b/tftpd.c
index a7561a5..1c08bb9 100644
index 29d21ff..e77c8e6 100644
--- a/tftpd.c
+++ b/tftpd.c
@@ -344,10 +344,14 @@ int main(int argc, char **argv)
@@ -368,9 +368,13 @@ int main(int argc, char **argv)
open_logger("atftpd", log_file, logging_level);
}
-#if defined(SOL_IP) && defined(IP_PKTINFO)
+#if defined(SOL_IP) && defined(IP_PKTINFO) || defined(__HAIKU__)
/* We need to retieve some information from incomming packets */
/* We need to retieve some information from incoming packets */
+#ifndef __HAIKU__
if (setsockopt(0, SOL_IP, IP_PKTINFO, &one, sizeof(one)) != 0)
+#else
@@ -115,9 +114,8 @@ index a7561a5..1c08bb9 100644
{
logger(LOG_WARNING, "Failed to set socket option: %s", strerror(errno));
}
#endif
--
2.30.2
2.37.3
From c5d55c6caf2d2ad918323cb4a554fc1b83363568 Mon Sep 17 00:00:00 2001
@@ -127,10 +125,10 @@ Subject: [PATCH] Disable IPv6.
diff --git a/tftp_file.c b/tftp_file.c
index 3817166..c44f24a 100644
index 163af45..cc314aa 100644
--- a/tftp_file.c
+++ b/tftp_file.c
@@ -505,10 +505,12 @@ int tftp_receive_file(struct client_data *data)
@@ -524,10 +524,12 @@ int tftp_receive_file(struct client_data *data)
err = setsockopt(mcast_sockfd, IPPROTO_IP,
IP_ADD_MEMBERSHIP,
&mreq.v4, sizeof(mreq.v4));
@@ -143,7 +141,7 @@ index 3817166..c44f24a 100644
if (err < 0)
{
perror("setsockopt");
@@ -585,10 +587,12 @@ int tftp_receive_file(struct client_data *data)
@@ -629,10 +631,12 @@ int tftp_receive_file(struct client_data *data)
err = setsockopt(mcast_sockfd, IPPROTO_IP,
IP_DROP_MEMBERSHIP,
&mreq.v4, sizeof(mreq.v4));
@@ -157,10 +155,10 @@ index 3817166..c44f24a 100644
{
perror("setsockopt");
diff --git a/tftp_mtftp.c b/tftp_mtftp.c
index 2ad55f8..59b8cd5 100644
index dd3ecc5..b2242cf 100644
--- a/tftp_mtftp.c
+++ b/tftp_mtftp.c
@@ -214,9 +214,11 @@ int tftp_mtftp_receive_file(struct client_data *data)
@@ -213,9 +213,11 @@ int tftp_mtftp_receive_file(struct client_data *data)
if (sa_mcast_group.ss_family == AF_INET)
err = setsockopt(mcast_sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
&mreq.v4, sizeof(mreq.v4));
@@ -172,7 +170,7 @@ index 2ad55f8..59b8cd5 100644
if (err < 0)
{
perror("atftp: setsockopt");
@@ -504,10 +506,12 @@ int tftp_mtftp_receive_file(struct client_data *data)
@@ -512,10 +514,12 @@ int tftp_mtftp_receive_file(struct client_data *data)
err = setsockopt(mcast_sockfd, IPPROTO_IP,
IP_DROP_MEMBERSHIP,
&mreq.v4, sizeof(mreq.v4));
@@ -186,10 +184,10 @@ index 2ad55f8..59b8cd5 100644
{
perror("setsockopt");
diff --git a/tftpd_file.c b/tftpd_file.c
index 65a0324..c7c3565 100644
index adfd0fd..3498c15 100644
--- a/tftpd_file.c
+++ b/tftpd_file.c
@@ -678,9 +678,11 @@ int tftpd_send_file(struct thread_data *data)
@@ -767,9 +767,11 @@ int tftpd_send_file(struct thread_data *data)
if (data->sa_mcast.ss_family == AF_INET)
setsockopt(data->sockfd, IPPROTO_IP, IP_MULTICAST_TTL,
&data->mcast_ttl, sizeof(data->mcast_ttl));
@@ -198,25 +196,26 @@ index 65a0324..c7c3565 100644
setsockopt(data->sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
&data->mcast_ttl, sizeof(data->mcast_ttl));
+#endif
/* set options data for OACK */
opt_set_multicast(data->tftp_options, data->mc_addr,
diff --git a/tftpd_mtftp.c b/tftpd_mtftp.c
index 0032905..ee39c12 100644
index 76a9c67..805e723 100644
--- a/tftpd_mtftp.c
+++ b/tftpd_mtftp.c
@@ -480,9 +480,11 @@ void *tftpd_mtftp_server(void *arg)
@@ -488,10 +488,11 @@ void *tftpd_mtftp_server(void *arg)
if (thread->sa_mcast.ss_family == AF_INET)
setsockopt(thread->sockfd, IPPROTO_IP, IP_MULTICAST_TTL,
setsockopt(thread->mcast_sockfd, IPPROTO_IP, IP_MULTICAST_TTL,
&data->mcast_ttl, sizeof(data->mcast_ttl));
+#ifdef USE_IPV6
else
setsockopt(thread->sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
setsockopt(thread->mcast_sockfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
&data->mcast_ttl, sizeof(data->mcast_ttl));
-
+#endif
/* give server thread access to mtftp options */
thread->mtftp_data = data;
--
2.30.2
2.37.3