From dddca17acdf6dcdb4829e131e3188b2695460565 Mon Sep 17 00:00:00 2001 From: huangxin Date: Tue, 14 Jun 2022 09:57:08 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E5=A2=9E=E5=8A=A0vxlan?= =?UTF-8?q?=E9=9A=A7=E9=81=93=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/lwip/src/arch_linux/core/vxlan_pkg.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/srcs/lwip/src/arch_linux/core/vxlan_pkg.c b/srcs/lwip/src/arch_linux/core/vxlan_pkg.c index 4d63964..fe7da1f 100644 --- a/srcs/lwip/src/arch_linux/core/vxlan_pkg.c +++ b/srcs/lwip/src/arch_linux/core/vxlan_pkg.c @@ -163,7 +163,7 @@ unsigned char *vxlan_pkg_encode(const unsigned char *pInBuf, int inSize, PVXLAN_ pkg->ip_head._chksum = 0x0000; pkg->udp_head.chksum = 0x0000; - checksum = udp_checksum(pBuf, total_len); + checksum = udp_checksum(pBuf, total_len); pkg->udp_head.chksum = checksum; IPH_CHKSUM_SET(&pkg->ip_head, inet_chksum(&pkg->ip_head, 20)); @@ -220,7 +220,7 @@ static void vxlan_pkg_head_init(PVXLAN_PEER pvxLan) { pkg->qinq_head.in_type = lwip_htons(QINQ_802_1_AD); } -int vxlan_peer_add(unsigned int vni, const char* pIp, const char* pMac) { +int vxlan_peer_add(unsigned int vni, const char *pIp, const char *pMac) { PVXLAN_PEER vxlan_peer; if (!VERIFY_STRING(pIp) || !VERIFY_STRING(pMac)) { @@ -233,7 +233,7 @@ int vxlan_peer_add(unsigned int vni, const char* pIp, const char* pMac) { uv_rwlock_rdunlock(&g_vxLanLinks.lock_peer); if (vxlan_peer == NULL) { - unsigned int peerIp; + unsigned int peerIp; unsigned char peerMac[6]; str_to_mac(pMac, peerMac); @@ -260,6 +260,8 @@ int vxlan_peer_add(unsigned int vni, const char* pIp, const char* pMac) { uv_rwlock_wrlock(&g_vxLanLinks.lock_peer); HASH_ADD_INT(g_pAllvxLanPeers, vni, vxlan_peer); uv_rwlock_wrunlock(&g_vxLanLinks.lock_peer); + + dzlog_debug("Add vxLan[vni = %d]: vSwitch: %s, %s\n", vni, pIp, pMac); } return ERR_SUCCESS;