diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-05-05 05:49:40 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-05-05 05:49:40 +0000 |
commit | f00639d104957ac1ccd097facdd0545138f61330 (patch) | |
tree | 8bc1d8185abdff5f5575101866f37f9e0436d209 /net-misc | |
parent | Version bump #176600 by Nuno Lopes. (diff) | |
download | gentoo-2-f00639d104957ac1ccd097facdd0545138f61330.tar.gz gentoo-2-f00639d104957ac1ccd097facdd0545138f61330.tar.bz2 gentoo-2-f00639d104957ac1ccd097facdd0545138f61330.zip |
Grab a bunch of fixes from SuSE #176558.
(Portage version: 2.1.2.5)
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/rarpd/ChangeLog | 13 | ||||
-rw-r--r-- | net-misc/rarpd/files/digest-rarpd-1.1-r3 | 3 | ||||
-rw-r--r-- | net-misc/rarpd/files/rarpd-1.1-daemon.patch | 29 | ||||
-rw-r--r-- | net-misc/rarpd/files/rarpd-1.1-fix-packet-growth-bug246891.diff | 15 | ||||
-rw-r--r-- | net-misc/rarpd/files/rarpd-1.1-libnet.diff | 155 | ||||
-rw-r--r-- | net-misc/rarpd/files/rarpd-1.1-printf.diff | 13 | ||||
-rw-r--r-- | net-misc/rarpd/rarpd-1.1-r3.ebuild | 34 |
7 files changed, 260 insertions, 2 deletions
diff --git a/net-misc/rarpd/ChangeLog b/net-misc/rarpd/ChangeLog index c79ead3f245e..d813b4e6cb0d 100644 --- a/net-misc/rarpd/ChangeLog +++ b/net-misc/rarpd/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-misc/rarpd -# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/ChangeLog,v 1.14 2006/11/26 19:49:44 corsair Exp $ +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/ChangeLog,v 1.15 2007/05/05 05:49:40 vapier Exp $ + +*rarpd-1.1-r3 (05 May 2007) + + 05 May 2007; Mike Frysinger <vapier@gentoo.org> + +files/rarpd-1.1-daemon.patch, + +files/rarpd-1.1-fix-packet-growth-bug246891.diff, + +files/rarpd-1.1-libnet.diff, +files/rarpd-1.1-printf.diff, + +rarpd-1.1-r3.ebuild: + Grab a bunch of fixes from SuSE #176558. 26 Nov 2006; Markus Rothe <corsair@gentoo.org> rarpd-1.1-r2.ebuild: Stable on ppc64 diff --git a/net-misc/rarpd/files/digest-rarpd-1.1-r3 b/net-misc/rarpd/files/digest-rarpd-1.1-r3 new file mode 100644 index 000000000000..db382189f425 --- /dev/null +++ b/net-misc/rarpd/files/digest-rarpd-1.1-r3 @@ -0,0 +1,3 @@ +MD5 04e2ca849e758d0b88c8281775ec3b58 rarpd-1.1.tar.gz 32053 +RMD160 107c38c5d349885c838a756552ff553b0f7a9390 rarpd-1.1.tar.gz 32053 +SHA256 936dc37422b658a8db98cd1d4d6b9fac63e13ac3fdc036e33dde996843baeba6 rarpd-1.1.tar.gz 32053 diff --git a/net-misc/rarpd/files/rarpd-1.1-daemon.patch b/net-misc/rarpd/files/rarpd-1.1-daemon.patch new file mode 100644 index 000000000000..7a2d68b856f8 --- /dev/null +++ b/net-misc/rarpd/files/rarpd-1.1-daemon.patch @@ -0,0 +1,29 @@ +--- rarpd.c.orig 2003-11-03 22:10:41.000304928 -0500 ++++ rarpd.c 2003-11-03 22:13:52.683164704 -0500 +@@ -429,12 +429,25 @@ + openlog(program_name, syslogflags, LOG_LOCAL1); + + if (!nofork) { ++ FILE *pidfile; + pid = fork(); +- if (pid > 0) exit(0); + if (pid < 0) { + syslog(LOG_ERR, "%s: fork failed: %s", program_name, strerror(errno)); + exit(1); + } ++ if (pid) { ++ pidfile = fopen("/var/run/rarpd.pid", "w"); ++ if (pidfile) { ++ fprintf(pidfile, "%i", pid); ++ fclose(pidfile); ++ } else ++ perror("Could not write pidfile"); ++ exit(0); ++ } ++ chdir("/"); ++ close(0); ++ close(1); ++ close(2); + } + + if (ethers == NULL) ethers = _PATH_ETHERS; diff --git a/net-misc/rarpd/files/rarpd-1.1-fix-packet-growth-bug246891.diff b/net-misc/rarpd/files/rarpd-1.1-fix-packet-growth-bug246891.diff new file mode 100644 index 000000000000..a020a0974d2c --- /dev/null +++ b/net-misc/rarpd/files/rarpd-1.1-fix-packet-growth-bug246891.diff @@ -0,0 +1,15 @@ +http://bugs.gentoo.org/176558 + +ripped from suse's rarpd-1.1-631.src.rpm: +* Wed Apr 18 2007 - nadvornik@suse.cz +- fixed unlimited packet growth [#246891] + +--- rarpd.c.orig 2007-02-21 11:41:25.099136000 +0100 ++++ rarpd.c 2007-02-21 12:39:49.837404920 +0100 +@@ -307,6 +307,8 @@ void send_rarpreply(unsigned char *dest_ + syslog(LOG_ERR, "%s: Write error: %s", program_name, libnet_geterror(ld)); + exit(1); + } ++ ++ libnet_clear_packet(ld); + } diff --git a/net-misc/rarpd/files/rarpd-1.1-libnet.diff b/net-misc/rarpd/files/rarpd-1.1-libnet.diff new file mode 100644 index 000000000000..c395309b130f --- /dev/null +++ b/net-misc/rarpd/files/rarpd-1.1-libnet.diff @@ -0,0 +1,155 @@ +ripped from suse + +--- rarpd.c ++++ rarpd.c +@@ -65,18 +65,12 @@ + #define ETHERSTRLEN sizeof("00:00:00:00:00:00") + #define IPSTRLEN sizeof(".xxx.xxx.xxx.xxx") + +-#ifdef NEW_LIBNET_INTERFACE +-#define open_link_interface libnet_open_link_interface +-#define link_int libnet_link_int +-#define build_arp libnet_build_arp +-#define get_ipaddr libnet_get_ipaddr +-#define get_hwaddr libnet_get_hwaddr +-#define build_ethernet libnet_build_ethernet +-#define write_link_layer libnet_write_link_layer +- +-/* Temporary workaround */ +-#define ARP_H LIBNET_ARP_H +-#endif ++struct _ipv4_arp_data_ { ++ u_char ar_sha[6]; /* sender hardware address */ ++ u_char ar_spa[4]; /* sender protocol address */ ++ u_char ar_tha[6]; /* target hardware address */ ++ u_char ar_tpa[4]; /* target protocol address */ ++}; + + extern char pcap_version[]; + extern int optind; +@@ -88,7 +82,7 @@ + static char *program_name; + + static pcap_t *pd; +-static struct link_int *ln; ++static libnet_t *ld; + static char *device, *ethers; + struct in_addr my_ipaddr; + static u_char my_hwaddr[ETHERADDRLEN]; +@@ -285,23 +279,34 @@ + void send_rarpreply(unsigned char *dest_hwaddr, + unsigned char *her_hwaddr, struct in_addr *her_ipaddr) + { +- char ebuf[PCAP_ERRBUF_SIZE]; +- u_char buf[ARP_H+ETH_H]; +- +- memset(buf, 0, ARP_H + ETH_H); +- +- /* Ethernet header */ +- build_ethernet(dest_hwaddr, my_hwaddr, ETHERTYPE_REVARP, NULL, 0, buf); ++ int c; ++ libnet_ptag_t t; + + /* ARP header */ +- build_arp(ARPHRD_ETHER, ETHERTYPE_IP, ++ t = libnet_build_arp(ARPHRD_ETHER, ETHERTYPE_IP, + ETHERADDRLEN, IPADDRLEN, + ARPOP_REVREPLY, + my_hwaddr, (u_char *)&(my_ipaddr.s_addr), + her_hwaddr, (u_char *)&(her_ipaddr->s_addr), +- NULL, 0, buf + ETH_H); ++ NULL, 0, ld, 0); ++ if (t == -1) { ++ syslog(LOG_ERR, "%s: Can't build ARP header: %s", program_name, libnet_geterror(ld)); ++ exit(1); ++ } + +- write_link_layer(ln, (const u_char *)device, buf, ARP_H + ETH_H); ++ /* Ethernet header */ ++ t = libnet_build_ethernet(dest_hwaddr, my_hwaddr, ETHERTYPE_REVARP, NULL, 0, ld, 0); ++ if (t == -1) { ++ syslog(LOG_ERR, "%s: Can't build ethernet header: %s", program_name, ++ libnet_geterror(ld)); ++ exit(1); ++ } ++ ++ c = libnet_write(ld); ++ if (c == -1) { ++ syslog(LOG_ERR, "%s: Write error: %s", program_name, libnet_geterror(ld)); ++ exit(1); ++ } + } + + +@@ -314,11 +319,13 @@ + unsigned short pro, hrd, op; + struct in_addr her_ipaddr; + struct libnet_arp_hdr *ap; ++ struct _ipv4_arp_data_ *ad; + struct hostent *hp; + char *ipp; + + bp += sizeof(struct libnet_ethernet_hdr); + ap = (struct libnet_arp_hdr *)bp; ++ ad = (struct _ipv4_arp_data_ *)(bp + sizeof(*ap)); + + pro = EXTRACT_16BITS (&ap->ar_pro); + hrd = EXTRACT_16BITS (&ap->ar_hrd); +@@ -331,10 +338,10 @@ + /* We only answer RARP requests */ + if (op != ARPOP_REVREQUEST) return; + +- sha = ap->ar_sha; +- spa = ap->ar_spa; +- tha = ap->ar_tha; +- tpa = ap->ar_tpa; ++ sha = ad->ar_sha; ++ spa = ad->ar_spa; ++ tha = ad->ar_tha; ++ tpa = ad->ar_tpa; + + if (my_ether_ntohost(toret, tha)) { + if (vflag) { +@@ -399,6 +406,7 @@ + int nofork, op, pid, syslogflags; + bpf_u_int32 localnet, netmask; + char ebuf[PCAP_ERRBUF_SIZE]; ++ char errbuf[LIBNET_ERRBUF_SIZE]; + char *cmdbuf; + struct bpf_program fcode; + +@@ -446,9 +454,9 @@ + } + } + +- ln = open_link_interface(device, ebuf); +- if (ln == NULL) { +- syslog(LOG_ERR, "%s: %s", program_name, ebuf); ++ ld = libnet_init(LIBNET_LINK, device, errbuf); ++ if (ld == NULL) { ++ syslog(LOG_ERR, "%s: %s", program_name, errbuf); + exit(1); + } + +@@ -465,8 +473,8 @@ + } + + memset(&my_ipaddr, 0, sizeof(my_ipaddr)); +- my_ipaddr.s_addr = htonl(get_ipaddr(ln, device, ebuf)); +- memcpy(my_hwaddr, (char *)get_hwaddr(ln, device, ebuf), ETHERADDRLEN); ++ my_ipaddr.s_addr = libnet_get_ipaddr4(ld); ++ memcpy(my_hwaddr, (char *) libnet_get_hwaddr(ld), ETHERADDRLEN); + + setuid(getuid()); + +--- configure ++++ configure +@@ -1734,7 +1734,7 @@ + #include "confdefs.h" + + int main() { +-libnet_open_link_interface("",""); ++libnet_open_link("",""); + ; return 0; } + EOF + if { (eval echo configure:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then diff --git a/net-misc/rarpd/files/rarpd-1.1-printf.diff b/net-misc/rarpd/files/rarpd-1.1-printf.diff new file mode 100644 index 000000000000..76e49469e0e5 --- /dev/null +++ b/net-misc/rarpd/files/rarpd-1.1-printf.diff @@ -0,0 +1,13 @@ +ripped from suse + +--- rarpd.c ++++ rarpd.c +@@ -238,7 +238,7 @@ + } + + fclose(f); +- if (dflag) fprintf(stderr, "Not found\n", hostname); ++ if (dflag) fprintf(stderr, "Not found: %s\n", hostname); + errno = ENOENT; + return -1; + } diff --git a/net-misc/rarpd/rarpd-1.1-r3.ebuild b/net-misc/rarpd/rarpd-1.1-r3.ebuild new file mode 100644 index 000000000000..e47d9a1d1588 --- /dev/null +++ b/net-misc/rarpd/rarpd-1.1-r3.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/rarpd/rarpd-1.1-r3.ebuild,v 1.1 2007/05/05 05:49:40 vapier Exp $ + +inherit eutils + +DESCRIPTION="Reverse Address Resolution Protocol Daemon" +HOMEPAGE="ftp://ftp.dementia.org/pub/net-tools" +SRC_URI="ftp://ftp.dementia.org/pub/net-tools/${P}.tar.gz" + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="" + +DEPEND=">=net-libs/libnet-1.1 + net-libs/libpcap" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-daemon.patch + epatch "${FILESDIR}"/${P}-libnet.diff + epatch "${FILESDIR}"/${P}-fix-packet-growth-bug246891.diff #176558 + epatch "${FILESDIR}"/${P}-printf.diff +} + +src_install() { + dosbin rarpd || die + doman rarpd.8 + dodoc AUTHORS README TODO VERSION INSTALL + newconfd "${FILESDIR}"/rarpd.conf.d rarpd + newinitd "${FILESDIR}"/rarpd.init.d rarpd +} |