On 03.02.2021 06:51, Roy Marples wrote:
Module Name: src
Committed By: roy
Date: Wed Feb 3 05:51:40 UTC 2021
Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h
src/sys/netinet: if_ether.h igmp.h in.h ip.h ip6.h ip_carp.h ip_icmp.h
ip_mroute.h ip_var.h tcp.h tcp_debug.h tcp_var.h udp.h udp_var.h
Log Message:
Remove __packed from various network structures
They are already network aligned and adding the __packed attribute
just causes needless compiler warnings about accssing members of packed
objects.
This changes the ABI for userland programs. With __packed, these
structures, whenever contain at least 2-byte data, can be placed in a
different location inside another structure now.
#include <sys/cdefs.h>
#include <stdio.h>
#include <stdint.h>
#include <stdalign.h>
struct aaa {
uint16_t a;
uint8_t b;
uint8_t c;
} __packed;
struct aaa2 {
uint8_t x;
struct aaa y;
};
struct bbb {
uint16_t a;
uint8_t b;
uint8_t c;
};
struct bbb2 {
uint8_t x;
struct bbb y;
};