mirror of
https://github.com/troglobit/finit.git
synced 2026-10-30 12:50:34 +00:00
Work around compiler error for breaking strict-aliasing rules
This commit fixes the following warning on an ARM eabi/uClibc system. helpers.c:86: error: dereferencing pointer 'a' does break strict-aliasing rules The fix is trivial. Simply set IPv4 addressing scheme in the struct ifreq instead of the struct sockaddr_in, whic is just a pointer into the same ifreq anyway. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
814ff1f77e
commit
1fece1f9b5
1 file changed
+1
-1
@@ -83,7 +83,7 @@ void ifconfig(char *name, char *inet, char *mask, int up)
|
|||||||
|
|
||||||
memset(&ifr, 0, sizeof (ifr));
|
memset(&ifr, 0, sizeof (ifr));
|
||||||
strlcpy(ifr.ifr_name, name, IFNAMSIZ);
|
strlcpy(ifr.ifr_name, name, IFNAMSIZ);
|
||||||
a->sin_family = AF_INET;
|
ifr.ifr_addr.sa_family = AF_INET;
|
||||||
|
|
||||||
if (up) {
|
if (up) {
|
||||||
inet_aton(inet, &a->sin_addr);
|
inet_aton(inet, &a->sin_addr);
|
||||||
|
|||||||
Reference in new issue
Block a user