net: convert NET_MAXDEFRAG to Kconfig
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 7 Feb 2020 15:17:42 +0000 (15:17 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 13 Feb 2020 15:10:50 +0000 (10:10 -0500)
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
net/Kconfig
net/net.c
scripts/config_whitelist.txt

index a07f674..96bbce1 100644 (file)
@@ -29,6 +29,16 @@ config IP_DEFRAG
          Selecting this will enable IP datagram reassembly according
          to the algorithm in RFC815.
 
+config NET_MAXDEFRAG
+       int "Size of buffer used for IP datagram reassembly"
+       depends on IP_DEFRAG
+       default 16384
+       range 1024 65536
+       help
+         This defines the size of the statically allocated buffer
+         used for reassembly, and thus an upper bound for the size of
+         IP datagrams that can be received.
+
 config TFTP_BLOCKSIZE
        int "TFTP block size"
        default 1468
index d8a60b6..087d399 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -883,9 +883,6 @@ int net_send_ip_packet(uchar *ether, struct in_addr dest, int dport, int sport,
  * to the algorithm in RFC815. It returns NULL or the pointer to
  * a complete packet, in static storage
  */
-#ifndef CONFIG_NET_MAXDEFRAG
-#define CONFIG_NET_MAXDEFRAG 16384
-#endif
 #define IP_PKTSIZE (CONFIG_NET_MAXDEFRAG)
 
 #define IP_MAXUDP (IP_PKTSIZE - IP_HDR_SIZE)
index 874f268..405c62e 100644 (file)
@@ -1212,7 +1212,6 @@ CONFIG_NETSPACE_LITE_V2
 CONFIG_NETSPACE_MAX_V2
 CONFIG_NETSPACE_MINI_V2
 CONFIG_NETSPACE_V2
-CONFIG_NET_MAXDEFRAG
 CONFIG_NET_MULTI
 CONFIG_NET_RETRY_COUNT
 CONFIG_NEVER_ASSERT_ODT_TO_CPU