TSG-17749 tsg-service-chaining-engine更改VXLAN Frame源端口的计算方式

This commit is contained in:
luwenpeng
2023-11-20 10:31:21 +08:00
parent 83f9880ff0
commit 134d2c82b7
14 changed files with 327 additions and 271 deletions

View File

@@ -161,6 +161,29 @@ static int health_check_method_table_add(struct session_table_addr *table, char
return 0;
}
#define CHECKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff))
static inline int checksum(uint16_t *data, int len)
{
int sum = 0;
int nleft = len;
uint16_t ans = 0;
uint16_t *w = data;
while (nleft > 1)
{
sum += *w++;
nleft -= 2;
}
if (nleft == 1)
{
*(char *)(&ans) = *(char *)w;
sum += ans;
}
return sum;
}
static int send_icmp_pkt(char *addr)
{
int sockfd;