summaryrefslogtreecommitdiff
path: root/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch')
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch63
1 files changed, 63 insertions, 0 deletions
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) {