]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Convert CONFIG_UDP_CHECKSUM to Kconfig
authorSimon Glass <sjg@chromium.org>
Sat, 18 Dec 2021 18:27:49 +0000 (11:27 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 21 Jan 2022 19:01:34 +0000 (14:01 -0500)
This converts the following to Kconfig:
   CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>
13 files changed:
configs/M5208EVBE_defconfig
configs/M53017EVB_defconfig
configs/M5329AFEE_defconfig
configs/M5329BFEE_defconfig
configs/M5373EVB_defconfig
include/configs/M5208EVBE.h
include/configs/M53017EVB.h
include/configs/M5329EVB.h
include/configs/M5373EVB.h
include/configs/sandbox.h
net/Kconfig
net/net.c
scripts/config_whitelist.txt

index cc307ce43b233456e370e98f6ccc78137ce33916..e79791cdfd0050c11a1cead84ad9a56651dd967e 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x2000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_UDP_CHECKSUM=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_SYS_FSL_I2C_OFFSET=0x58000
index 1cd48d6c4ae451a12aab772454dcf4b5c0a7073e..b8292fdccffc0773554c67dd054e94f650a62aeb 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0x40000
+CONFIG_UDP_CHECKSUM=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_SYS_FSL_I2C_OFFSET=0x58000
index 8a7a2d64f540943d8d315f5d51d72e51cc757dad..a6896650b19d574290bdc1aa418f619781f2f75b 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_ENV_ADDR=0x4000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_UDP_CHECKSUM=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_SYS_FSL_I2C_OFFSET=0x58000
index f40e86ff222d1de06ac0f5b155315a8c0f7e36bc..c640a3c38e81fe50797176bce1612203e6b0fe37 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_ENV_ADDR=0x4000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_UDP_CHECKSUM=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_SYS_FSL_I2C_OFFSET=0x58000
index 8e61b72887d79468ad38b2374e2d4616b3e1ef7c..c5aa3fd5e469e5e4e0112a8705d23c0c42a5480f 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_DATE=y
 CONFIG_ENV_ADDR=0x4000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_UDP_CHECKSUM=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_SYS_FSL_I2C_OFFSET=0x58000
index 5ed624c7b761a4ba4b40d7954615eb259e99c3d1..3723c5db0d8a389b5334b66e9d8bfe1ba21e9eb0 100644 (file)
@@ -39,8 +39,6 @@
 
 /* I2C */
 
-#define CONFIG_UDP_CHECKSUM
-
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_IPADDR    192.162.1.2
 #      define CONFIG_NETMASK   255.255.255.0
index 5db189ae2db47af811a30aa3b7c3957d06f6d8df..d70ebac7fd441a37f86d481d228aaebbea6bf0f8 100644 (file)
@@ -54,8 +54,6 @@
 
 /* I2C */
 
-#define CONFIG_UDP_CHECKSUM
-
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_IPADDR    192.162.1.2
 #      define CONFIG_NETMASK   255.255.255.0
index f96f54ef65bcc9c9592416386be3887f1d472ce7..e59187d719d2857fcd12837b662f71f028cac6b7 100644 (file)
@@ -48,8 +48,6 @@
 
 /* I2C */
 
-#define CONFIG_UDP_CHECKSUM
-
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_IPADDR    192.162.1.2
 #      define CONFIG_NETMASK   255.255.255.0
index b7906013e09eee36878e8717ee57f1f08ee65b8b..2a56c9056dd555552a0d0d5bd350679b15709874 100644 (file)
@@ -50,8 +50,6 @@
 
 /* I2C */
 
-#define CONFIG_UDP_CHECKSUM
-
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_IPADDR    192.162.1.2
 #      define CONFIG_NETMASK   255.255.255.0
index 1dd21d5e9251713f3f096f7d7b58f50f219bd7d8..2cb8a90f5eaa01acbbcf97af89903f76659abc65 100644 (file)
@@ -25,7 +25,6 @@
 #define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
                                        115200}
 
-#define CONFIG_UDP_CHECKSUM
 #define CONFIG_TIMESTAMP
 #define CONFIG_BOOTP_SERVERIP
 
index 8e9579afb2bada131d0874d0a79d242131eb7211..8ddea2823acd567f700fc6708a709cebe73f5baf 100644 (file)
@@ -108,4 +108,11 @@ config KEEP_SERVERADDR
          enabled, when an ARP reply is received, the server's IP address is
          written there.
 
+config UDP_CHECKSUM
+       bool "Check the UDP checksum"
+       help
+         Enable this to verify the checksum on UDP packets. If the checksum
+         is wrong then the packet is discussed and an error is shown, like
+         "UDP wrong checksum 29374a23 30ff3826"
+
 endif   # if NET
index c2992a0908bd9c4cf0b24f5a413ad7d364716bde..43e230aeb92546a25302546bb0a013fbec1ed4d4 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1264,8 +1264,7 @@ void net_process_received_packet(uchar *in_packet, int len)
                           "received UDP (to=%pI4, from=%pI4, len=%d)\n",
                           &dst_ip, &src_ip, len);
 
-#ifdef CONFIG_UDP_CHECKSUM
-               if (ip->udp_xsum != 0) {
+               if (IS_ENABLED(CONFIG_UDP_CHECKSUM) && ip->udp_xsum != 0) {
                        ulong   xsum;
                        u8 *sumptr;
                        ushort  sumlen;
@@ -1298,7 +1297,6 @@ void net_process_received_packet(uchar *in_packet, int len)
                                return;
                        }
                }
-#endif
 
 #if defined(CONFIG_NETCONSOLE) && !defined(CONFIG_SPL_BUILD)
                nc_input_packet((uchar *)ip + IP_UDP_HDR_SIZE,
index f67f6eb6af915858c37efa7d51536caa02212ba0..fa242540d372fdaac5c0d073b03d761769437d16 100644 (file)
@@ -2087,7 +2087,6 @@ CONFIG_UBI_SIZE
 CONFIG_UBOOTPATH
 CONFIG_UBOOT_SECTOR_COUNT
 CONFIG_UBOOT_SECTOR_START
-CONFIG_UDP_CHECKSUM
 CONFIG_UEC_ETH
 CONFIG_UEC_ETH2
 CONFIG_UPDATEB