🐞 fix(TSG-14170): Health Check support None

This commit is contained in:
wangmenglan
2023-07-13 15:24:50 +08:00
parent 23d05e7fee
commit 1a7dba0b65
5 changed files with 364 additions and 106 deletions

View File

@@ -116,6 +116,10 @@ int get_ip_by_device_name(const char *dev_name, char *ip_buff);
int get_mac_by_device_name(const char *dev_name, char *mac_buff);
int str_to_mac(const char *str, char *mac_buff);
#define CHECKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
int checksum(uint16_t *addr, int len);
#ifdef __cpluscplus
}
#endif

View File

@@ -156,10 +156,7 @@ void throughput_metrics_inc(struct throughput_metrics *iterm, uint64_t n_pkts, u
/******************************************************************************
* protocol
******************************************************************************/
#define CHECKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
static int checksum(uint16_t *addr, int len)
int checksum(uint16_t *addr, int len)
{
int sum = 0;
int nleft = len;