Eliminate a warning

This commit is contained in:
Gregory Nutt 2017-07-10 14:36:56 -06:00
parent ad2f724daf
commit ae1eeada8a

View File

@ -47,10 +47,10 @@
#include <stdint.h>
#include <stdbool.h>
#include <nuttx/net/netconfig.h>
#include <nuttx/net/ethernet.h>
#include <nuttx/net/ip.h>
#include <nuttx/net/udp.h>
#include <nuttx/net/ip.h>
#include <nuttx/net/ethernet.h>
#include <nuttx/net/netconfig.h>
/****************************************************************************
* Pre-processor Definitions
@ -92,17 +92,28 @@
*
* 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.
* may support a different UDP MSS value. Here, if Ethernet is enabled,
* 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_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
# ifdef CONFIG_CPP_HAVE_WARNING
# warning "MSS is too small for TFTP"
# warning "Minimum MSS is too small for TFTP"
# endif
#else
# define TFTP_PACKETSIZE TFTP_MAXPACKETSIZE