TSG-17749 tsg-service-chaining-engine更改VXLAN Frame源端口的计算方式
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user