From a6d1a5aa9decb7a4850c66c3853a2565d8e936b8 Mon Sep 17 00:00:00 2001 From: huangxin Date: Wed, 15 Jun 2022 15:23:18 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E5=A2=9E=E5=8A=A0vxlan?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8C=85=E5=A4=B4=E9=83=A8=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/lwip/src/arch_linux/core/vxlan_pkg.c | 39 ++--------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/srcs/lwip/src/arch_linux/core/vxlan_pkg.c b/srcs/lwip/src/arch_linux/core/vxlan_pkg.c index efe4544..5dfe6bd 100644 --- a/srcs/lwip/src/arch_linux/core/vxlan_pkg.c +++ b/srcs/lwip/src/arch_linux/core/vxlan_pkg.c @@ -203,7 +203,6 @@ static void vxlan_pkg_head_init(PVXLAN_PKG_HEAD pvxLan) { pkg->vxlan_head.res1 = 0x00; pkg->vxlan_head.res2 = 0x00; pkg->vxlan_head.res3 = 0x00; - //pkg->vxlan_head.vni_reserved = lwip_htonl(VXLAN_VIN_ID_PACK(pvxLan->vni)); // 设置内层ETH头部 // 设置内层报文类型 @@ -237,6 +236,8 @@ int vxlan_peer_add(const char *pIp, const char *pMac) { return -ERR_MALLOC_MEMORY; } + g_vxLanLinks.pkg_head = pkg; + memset(pkg, 0, sizeof(VXLAN_PKG_HEAD)); pkg->peerIp = lwip_htonl(peerIp); @@ -272,41 +273,5 @@ int vxlan_link_init(const char *pEthName) { return -ERR_SYS_INIT; } -#if 0 - PVXLAN_LINK pvxLan; - - if (!VERIFY_STRING(pEthName) || !VERIFY_STRING(pPeerIp) || !VERIFY_STRING(pPeerMac)) { - dzlog_error("Input parameters error: %s, %s, %s\n", - SAFETY_STR_STRING(pEthName), - SAFETY_STR_STRING(pPeerIp), - SAFETY_STR_STRING(pPeerMac)); - return -ERR_INPUT_PARAMS; - } - - pvxLan = (PVXLAN_LINK)malloc(sizeof(VXLAN_LINK)); - - if (pvxLan == NULL) { - dzlog_error("Create vxLan link error: %lu\n", sizeof(VXLAN_LINK)); - return -ERR_MALLOC_MEMORY; - } - - memset(pvxLan, 0, sizeof(VXLAN_LINK)); - - strncpy(pvxLan->vxlan_configure.ethName, pEthName, ETH_NAME_MAX); - str_to_mac(pPeerMac, pvxLan->vxlan_configure.ourMac); - - if (str_to_ipaddr(pPeerIp, &pvxLan->vxlan_configure.peerIp) == 0) { - dzlog_error("Get vxLan peer ip address failed: %s\n", pPeerIp); - return -ERR_SYS_INIT; - } - - if (get_nic_info(pEthName, &pvxLan->vxlan_configure.outIp, NULL, NULL, pvxLan->vxlan_configure.ourMac) - != ERR_SUCCESS) { - dzlog_error("Get NIC information failed\n"); - return -ERR_SYS_INIT; - } - - HASH_ADD_INT() -#endif return ERR_SUCCESS; }