pping: Fix struct alginment issues

Move some members in network_tuple and rtt_event around to avoid holes.

Also remove some uncecessary parentheses before & operator, and add
local definitions of AF_INET and AF_INET6.

Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
This commit is contained in:
Simon Sundberg
2021-02-09 13:00:28 +01:00
parent 670df84bd9
commit eafdf87d80
5 changed files with 18 additions and 21 deletions

View File

@@ -18,12 +18,12 @@
* is extended to work for other protocols than TCP
*/
struct network_tuple {
__u8 ipv; //AF_INET or AF_INET6
struct in6_addr saddr;
struct in6_addr daddr;
__u16 sport;
__u16 dport;
__u16 proto; //IPPROTO_TCP, IPPROTO_ICMP, QUIC etc
__u16 ipv; //AF_INET or AF_INET6
};
struct packet_id {
@@ -37,8 +37,8 @@ struct packet_timestamp {
};
struct rtt_event {
struct network_tuple flow;
__u64 rtt;
struct network_tuple flow;
};
#endif