Merge remote-tracking branch 'origin/master' into beacon802154

This commit is contained in:
Gregory Nutt 2017-07-13 13:55:12 -06:00
commit a8de1ab9ed

View File

@ -47,9 +47,10 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <nuttx/net/netconfig.h> #include <nuttx/net/udp.h>
#include <nuttx/net/ethernet.h>
#include <nuttx/net/ip.h> #include <nuttx/net/ip.h>
#include <nuttx/net/ethernet.h>
#include <nuttx/net/netconfig.h>
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
@ -91,17 +92,28 @@
* *
* In the case where there are multiple network devices with different * In the case where there are multiple network devices with different
* link layer protocols (CONFIG_NET_MULTILINK), each network device * link layer protocols (CONFIG_NET_MULTILINK), each network device
* may support a different UDP MSS value. Here we arbitrarily select * may support a different UDP MSS value. Here, if Ethernet is enabled,
* the minimum MSS for that case. * we (arbitrarily) assume that the Ethernet is link that will be used.
* if Ethernet is not one of the enabled interfaces, we (arbitrarily) select
* the minimum MSS.
*/ */
#define TFTP_DATAHEADERSIZE 4 #define TFTP_DATAHEADERSIZE 4
#define TFTP_MAXPACKETSIZE (TFTP_DATAHEADERSIZE+512) #define TFTP_MAXPACKETSIZE (TFTP_DATAHEADERSIZE+512)
#if MIN_UDP_MSS < TFTP_MAXPACKETSIZE #if defined(CONFIG_NET_ETHERNET)
# if ETH_UDP_MSS(IPv4_HDRLEN) < TFTP_MAXPACKETSIZE
# define TFTP_PACKETSIZE ETH_UDP_MSS(IPv4_HDRLEN)
# ifdef CONFIG_CPP_HAVE_WARNING
# warning "Ethernet MSS is too small for TFTP"
# endif
# else
# define TFTP_PACKETSIZE TFTP_MAXPACKETSIZE
# endif
#elif MIN_UDP_MSS < TFTP_MAXPACKETSIZE
# define TFTP_PACKETSIZE MIN_UDP_MSS # define TFTP_PACKETSIZE MIN_UDP_MSS
# ifdef CONFIG_CPP_HAVE_WARNING # ifdef CONFIG_CPP_HAVE_WARNING
# warning "uIP MSS is too small for TFTP" # warning "Minimum MSS is too small for TFTP"
# endif # endif
#else #else
# define TFTP_PACKETSIZE TFTP_MAXPACKETSIZE # define TFTP_PACKETSIZE TFTP_MAXPACKETSIZE