From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../ifplugd/files/ifplugd-0.28-strictalias.patch | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch (limited to 'sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch') diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch new file mode 100644 index 000000000000..ae8292dc17ac --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch @@ -0,0 +1,63 @@ +--- a/src/interface.c ++++ b/src/interface.c +@@ -89,6 +89,10 @@ + + interface_status_t interface_detect_beat_mii(int fd, char *iface) { + struct ifreq ifr; ++ union { ++ caddr_t *data; ++ unsigned short *usz; ++ } ifd; + + if (interface_auto_up) + interface_up(fd, iface); +@@ -103,7 +107,8 @@ + return IFSTATUS_ERR; + } + +- ((unsigned short*) &ifr.ifr_data)[1] = 1; ++ ifd.data = &ifr.ifr_data; ++ *++ifd.usz = 1; + + if (ioctl(fd, SIOCGMIIREG, &ifr) == -1) { + if (interface_do_message) +@@ -112,12 +117,17 @@ + return IFSTATUS_ERR; + } + +- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; ++ ifd.usz += 2; ++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; + } + + interface_status_t interface_detect_beat_priv(int fd, char *iface) { + struct ifreq ifr; +- ++ union { ++ caddr_t *data; ++ unsigned short *usz; ++ } ifd; ++ + if (interface_auto_up) + interface_up(fd, iface); + +@@ -131,7 +141,8 @@ + return IFSTATUS_ERR; + } + +- ((unsigned short*) &ifr.ifr_data)[1] = 1; ++ ifd.data = &ifr.ifr_data; ++ *++ifd.usz = 1; + + if (ioctl(fd, SIOCDEVPRIVATE+1, &ifr) == -1) { + if (interface_do_message) +@@ -140,7 +151,8 @@ + return IFSTATUS_ERR; + } + +- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; ++ ifd.usz += 2; ++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; + } + + interface_status_t interface_detect_beat_ethtool(int fd, char *iface) { -- cgit v1.2.3