diff options
author | 2007-03-23 14:15:09 +0000 | |
---|---|---|
committer | 2007-03-23 14:15:09 +0000 | |
commit | e34de32d2d8bd31b6f90a61087df686eaeaf726d (patch) | |
tree | 8336e91b73c6aaea745b834946b716102628b2e0 /sys-apps/ifplugd | |
parent | Version bump (diff) | |
download | gentoo-2-e34de32d2d8bd31b6f90a61087df686eaeaf726d.tar.gz gentoo-2-e34de32d2d8bd31b6f90a61087df686eaeaf726d.tar.bz2 gentoo-2-e34de32d2d8bd31b6f90a61087df686eaeaf726d.zip |
Fix aliasing QA, #171415.
(Portage version: 2.1.2.2)
Diffstat (limited to 'sys-apps/ifplugd')
-rw-r--r-- | sys-apps/ifplugd/ChangeLog | 10 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/digest-ifplugd-0.28-r8 | 3 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch | 63 | ||||
-rw-r--r-- | sys-apps/ifplugd/ifplugd-0.28-r8.ebuild | 70 |
4 files changed, 144 insertions, 2 deletions
diff --git a/sys-apps/ifplugd/ChangeLog b/sys-apps/ifplugd/ChangeLog index c2c7c7d12865..8faa291b8656 100644 --- a/sys-apps/ifplugd/ChangeLog +++ b/sys-apps/ifplugd/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/ifplugd -# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/ChangeLog,v 1.43 2006/10/03 21:48:52 wolf31o2 Exp $ +# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/ChangeLog,v 1.44 2007/03/23 14:15:09 uberlord Exp $ + +*ifplugd-0.28-r8 (23 Mar 2007) + + 23 Mar 2007; Roy Marples <uberlord@gentoo.org> + +files/ifplugd-0.28-strictalias.patch, +ifplugd-0.28-r8.ebuild: + Fix aliasing QA, #171415. 03 Oct 2006; Chris Gianelloni <wolf31o2@gentoo.org> ifplugd-0.28-r7.ebuild: diff --git a/sys-apps/ifplugd/files/digest-ifplugd-0.28-r8 b/sys-apps/ifplugd/files/digest-ifplugd-0.28-r8 new file mode 100644 index 000000000000..d58875572dca --- /dev/null +++ b/sys-apps/ifplugd/files/digest-ifplugd-0.28-r8 @@ -0,0 +1,3 @@ +MD5 df6f4bab52f46ffd6eb1f5912d4ccee3 ifplugd-0.28.tar.gz 142677 +RMD160 09914a1914a4432822bb660d6aef194debe688f1 ifplugd-0.28.tar.gz 142677 +SHA256 474754ac4ab32d738cbf2a4a3e87ee0a2c71b9048a38bdcd7df1e4f9fd6541f0 ifplugd-0.28.tar.gz 142677 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..3c5de8a2e731 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch @@ -0,0 +1,63 @@ +--- src/interface.c.orig 2007-03-23 13:29:40.000000000 +0000 ++++ src/interface.c 2007-03-23 13:30:05.000000000 +0000 +@@ -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) { diff --git a/sys-apps/ifplugd/ifplugd-0.28-r8.ebuild b/sys-apps/ifplugd/ifplugd-0.28-r8.ebuild new file mode 100644 index 000000000000..ff0b87dc4bad --- /dev/null +++ b/sys-apps/ifplugd/ifplugd-0.28-r8.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/ifplugd-0.28-r8.ebuild,v 1.1 2007/03/23 14:15:09 uberlord Exp $ + +inherit eutils + +DESCRIPTION="Brings up/down ethernet ports automatically with cable detection" +HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/" +SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="doc" + +DEPEND="dev-util/pkgconfig + doc? ( www-client/lynx ) + >=dev-libs/libdaemon-0.5" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${P}-nlapi.diff" + epatch "${FILESDIR}/${P}-interface.patch" + epatch "${FILESDIR}/${P}-strictalias.patch" +} + +src_compile() { + econf $(use_enable doc lynx) \ + --with-initdir=/etc/init.d \ + --disable-xmltoman \ + --disable-subversion \ + || die "econf failed" + emake || die "emake failed" +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + # Remove init.d configuration as we no longer use it + rm -rf "${D}/etc/ifplugd" "${D}/etc/init.d/${PN}" + + dodir "/etc/${PN}" + exeinto "/etc/${PN}" + newexe "${FILESDIR}/${PN}.action" "${PN}.action" || die + + cd "${S}/doc" + dodoc README SUPPORTED_DRIVERS + use doc && dohtml *.{html,css} +} + +pkg_postinst() { + # Warn about old init script + einfo "baselayout now starts ifplugd automatically on wired interfaces" + einfo "If you do not want this behaviour then add !plug to your modules" + einfo "in /etc/conf.d/net like so" + einfo " modules=( \"!plug\" )" + + if [[ -e "${ROOT}/etc/init.d/ifplugd" \ + || -e "${ROOT}/etc/conf.d/ifplugd" ]] ; then + echo + ewarn "You should stop the ifplugd service now and remove its init" + ewarn "script and config file" + if [[ ${ROOT} == "/" ]] ; then + ewarn " /etc/init.d/ifplugd stop" + ewarn " rc-update del ifplugd" + ewarn " rm -f /etc/{conf,init}.d/ifplugd" + fi + fi +} |