From 34bb35944775a517118ac9abfcf5d29bc8c858a6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 15 Nov 2014 13:13:23 -0600 Subject: [PATCH] Network: All logic will now handle varialbe length link layer protocol headers within incoming packets. This permits use of multiple network interfaces with differing data links. For example, ETHERNET + SLIP --- include/netutils/httpd.h | 7 ++++++- netutils/tftpc/tftpc_internal.h | 13 +++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/netutils/httpd.h b/include/netutils/httpd.h index d5a9b21c4..1ae9b7c1e 100644 --- a/include/netutils/httpd.h +++ b/include/netutils/httpd.h @@ -77,9 +77,14 @@ /* For efficiency reasons, the size of the IO buffer should be a multiple * of the TCP MSS value. Also, the current design requires that the IO * buffer be sufficiently large to contain the entire GET request. + * + * In the case where there are multiple network devices with different + * link layer protocols (CONFIG_NET_MULTILINK), each network device + * may support a different TCP MSS value. Here we arbitrarily select + * the minimum MSS for that case. */ -#define HTTPD_IOBUFFER_SIZE (3*TCP_MSS) +#define HTTPD_IOBUFFER_SIZE (3*MIN_TCP_MSS) /* This is the maximum size of a file path */ diff --git a/netutils/tftpc/tftpc_internal.h b/netutils/tftpc/tftpc_internal.h index 436090193..31a3faade 100644 --- a/netutils/tftpc/tftpc_internal.h +++ b/netutils/tftpc/tftpc_internal.h @@ -84,15 +84,20 @@ #define TFTP_ERRHEADERSIZE 4 #define TFTP_DATAHEADERSIZE 4 -/* The maximum size for TFTP data is determined by the configured uIP packet - * size (but cannot exceed 512 + sizeof(TFTP_DATA header). +/* The maximum size for TFTP data is determined by the configured UDP packet + * payload size (UDP_MSS), but cannot exceed 512 + sizeof(TFTP_DATA header). + * + * In the case where there are multiple network devices with different + * link layer protocols (CONFIG_NET_MULTILINK), each network device + * may support a different UDP MSS value. Here we arbitrarily select + * the minimum MSS for that case. */ #define TFTP_DATAHEADERSIZE 4 #define TFTP_MAXPACKETSIZE (TFTP_DATAHEADERSIZE+512) -#if UDP_MSS < TFTP_MAXPACKETSIZE -# define TFTP_PACKETSIZE UDP_MSS +#if MIN_UDP_MSS < TFTP_MAXPACKETSIZE +# define TFTP_PACKETSIZE MIN_UDP_MSS # ifdef CONFIG_CPP_HAVE_WARNING # warning "uIP MSS is too small for TFTP" # endif