]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix unaligned access in macOS, FreeBSD, Solaris hwaddr
authorArne Schwabe <arne@rfc2549.org>
Sun, 31 Dec 2023 17:34:31 +0000 (18:34 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 31 Dec 2023 17:50:12 +0000 (18:50 +0100)
commit5380fe02b9ef4f0f2b1f0eb52100b7922965dfdb
treea58bfdadb5763dc35a50214163d81c0060f55781
parentcbcecdb38a617f8c17e8e52d15ac669e15538697
Fix unaligned access in macOS, FreeBSD, Solaris hwaddr

The undefined behaviour USAN clang checker found this.

This fix is a bit messy but so are the original structures.

Since the API on Solaris/Illuminos does not return the AF_LINK
sockaddr type we are interested in, there is little value in
fixing the code on that platform to iterate through a list
that does not contain the element we are looking for.

Add includes stddef.h for offsetof and integer.h for max_int.

Change-Id: Ia797c8801fa9a9bc10b6674efde5fdbd7132e4a8
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20231231173431.31356-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27885.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit f13331005d5a75f2788685485d46be1fe2f133a1)
src/openvpn/route.c