perf: Optimize IPID (Avoid the futex of rand() while ensuring that IPID increases monotonically)

This commit is contained in:
luwenpeng
2023-10-11 18:11:48 +08:00
parent db517610e0
commit 49ccb5149f
5 changed files with 15 additions and 11 deletions

View File

@@ -105,7 +105,7 @@ struct udp_hdr
} __attribute__((__packed__));
void build_udp_header(const char *l3_hdr, int l3_hdr_len, struct udp_hdr *udp_hdr, uint16_t udp_sport, uint16_t udp_dport, int payload_len);
void build_ip_header(struct ip *ip_hdr, uint8_t next_protocol, const char *src_addr, const char *dst_addr, uint16_t payload_len);
void build_ip_header(struct ip *ip_hdr, uint8_t next_protocol, uint16_t ipid, const char *src_addr, const char *dst_addr, uint16_t payload_len);
void build_ether_header(struct ethhdr *eth_hdr, uint16_t next_protocol, const char *src_mac, const char *dst_mac);
/******************************************************************************