diff options
author | Volodymyr Huti <volodymyr.huti@gmail.com> | 2022-10-13 14:20:06 +0300 |
---|---|---|
committer | Volodymyr Huti <volodymyr.huti@gmail.com> | 2022-10-22 15:11:29 +0300 |
commit | 6e5f9980a8a71015a228279e07970621d23c7b35 (patch) | |
tree | 73ae1d6596a175c76a0d24867592a4016c0592c5 /accel-pppd/ctrl/pppoe | |
parent | 2b865db72bc2ddc6411950d72f1c23e8ef115b8a (diff) | |
download | accel-ppp-6e5f9980a8a71015a228279e07970621d23c7b35.tar.gz accel-ppp-6e5f9980a8a71015a228279e07970621d23c7b35.zip |
T72: Fix compilations warnings for unaligned variable access
- IPoE/DHCP4: Specify minimal suitable alignment explicitly.
We need to guarantee 2 byte alignment for the `hdr` pointer in
`ip_csum(uint16_t *buf)` calculation
- PPPOE: Suppress false-positive warning for `sockaddr_pppox`.
Similiar issue: https://github.com/kernelslacker/trinity/pull/40
- Introduce tmp variables to avoid alignment issues for SSTP/DHCPv6
For additional details:
https://phabricator.accel-ppp.org/T72
Signed-off-by: Volodymyr Huti <v.huti@vyos.io>
Diffstat (limited to 'accel-pppd/ctrl/pppoe')
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 43163f16..44b094b0 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -433,6 +433,8 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui return conn; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" static void connect_channel(struct pppoe_conn_t *conn) { int sock; @@ -486,6 +488,7 @@ out_err_close: out_err: disconnect(conn); } +#pragma GCC diagnostic pop static struct pppoe_conn_t *find_channel(struct pppoe_serv_t *serv, const uint8_t *cookie) { |