1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-10 14:12:58 +00:00

added struct sockaddr_ll to union sockaddr_union to avoid "strict aliasing"

This commit is contained in:
Gerhard Rieger 2010-01-04 12:59:56 +01:00
parent 30a3ec3baa
commit a8a8626c2f
5 changed files with 15 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/* source: xio-interface.c */
/* Copyright Gerhard Rieger 2008 */
/* Copyright Gerhard Rieger 2010 */
/* Published under the GNU General Public License V.2, see file COPYING */
/* this file contains the source for opening addresses of raw socket type */
@ -60,9 +60,9 @@ int _xioopen_interface(const char *ifname,
needbind = true;
}
/*!!! parse by ':' */
((struct sockaddr_ll *)&us)->sll_family = pf;
((struct sockaddr_ll *)&us)->sll_protocol = htons(ETH_P_ALL);
((struct sockaddr_ll *)&us)->sll_ifindex = ifidx;
us.ll.sll_family = pf;
us.ll.sll_protocol = htons(ETH_P_ALL);
us.ll.sll_ifindex = ifidx;
uslen = sizeof(sall);
needbind = true;
xfd->peersa = (union sockaddr_union)us;