summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2020-01-31 16:27:53 +0100
committerJeroen Roovers <jer@gentoo.org>2020-01-31 16:28:18 +0100
commit24a56226228d802b32fe2f383dcb4301a447b41f (patch)
tree2cbed1c63e82626e0e41134b5afaa5add64006c6 /net-misc/nemesis
parentdev-ml/llvm-ocaml: Add VE target (diff)
downloadgentoo-24a56226228d802b32fe2f383dcb4301a447b41f.tar.gz
gentoo-24a56226228d802b32fe2f383dcb4301a447b41f.tar.bz2
gentoo-24a56226228d802b32fe2f383dcb4301a447b41f.zip
net-misc/nemesis: Fix CFLAGS=-fno-common
Package-Manager: Portage-2.3.86, Repoman-2.3.20 Closes: https://bugs.gentoo.org/show_bug.cgi?id=707292 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Diffstat (limited to 'net-misc/nemesis')
-rw-r--r--net-misc/nemesis/files/nemesis-1.4-fno-common.patch150
-rw-r--r--net-misc/nemesis/nemesis-1.4-r2.ebuild36
2 files changed, 186 insertions, 0 deletions
diff --git a/net-misc/nemesis/files/nemesis-1.4-fno-common.patch b/net-misc/nemesis/files/nemesis-1.4-fno-common.patch
new file mode 100644
index 000000000000..068fef61b6e4
--- /dev/null
+++ b/net-misc/nemesis/files/nemesis-1.4-fno-common.patch
@@ -0,0 +1,150 @@
+--- a/src/nemesis.c
++++ b/src/nemesis.c
+@@ -12,6 +12,8 @@
+ #include <string.h>
+ #include "nemesis.h"
+
++int mode; /* injection mode */
++
+ int main(int argc, char **argv)
+ {
+ char **avtmp, *avval;
+--- a/src/nemesis-dns.c
++++ b/src/nemesis-dns.c
+@@ -37,6 +37,8 @@
+ static void dns_validatedata(void);
+ static void dns_verbose(void);
+
++int state; /* default to UDP */
++
+ void nemesis_dns(int argc, char **argv)
+ {
+ const char *module = "DNS Packet Injection";
+--- a/src/nemesis-dns.h
++++ b/src/nemesis-dns.h
+@@ -32,7 +32,7 @@
+ #include <libnet-1.0.h>
+ #include "nemesis.h"
+
+-int state; /* default to UDP */
++extern int state; /* default to UDP */
+
+ int builddns(ETHERhdr *, IPhdr *, TCPhdr *, UDPhdr *, DNShdr *, FileData *,
+ FileData *, FileData *, char *);
+--- a/src/nemesis.h
++++ b/src/nemesis.h
+@@ -122,6 +122,8 @@
+ extern int got_ipoptions;
+ extern int got_tcpoptions;
+
++extern int mode; /* injection mode */
++
+ typedef struct _FileData
+ {
+ int32_t file_s; /* file size */
+--- a/src/nemesis-icmp.c
++++ b/src/nemesis-icmp.c
+@@ -38,6 +38,8 @@
+ static void icmp_validatedata(void);
+ static void icmp_verbose(void);
+
++int got_origoptions;
++
+ void nemesis_icmp(int argc, char **argv)
+ {
+ const char *module = "ICMP Packet Injection";
+--- a/src/nemesis-icmp.h
++++ b/src/nemesis-icmp.h
+@@ -42,8 +42,7 @@
+ #include <libnet-1.0.h>
+ #include "nemesis.h"
+
+-int mode; /* ICMP injection mode */
+-int got_origoptions;
++extern int got_origoptions;
+
+ int buildicmp(ETHERhdr *, IPhdr *, ICMPhdr *, IPhdr *, FileData *, FileData *,
+ FileData *, char *);
+--- a/src/nemesis-ospf.c
++++ b/src/nemesis-ospf.c
+@@ -15,6 +15,37 @@
+ #include <pcap.h>
+ #endif
+
++u_short id, /* IP id */
++ frag, /* frag shit */
++ mtusize, /* Max dgram length (DBD) */
++ num, /* LSA_RTR num */
++ interval, /* secs since last pkt sent */
++ rtr_flags, /* LSA_RTR flags */
++ metric, /* OSPF metric */
++ ospf_age; /* OSPF advertisement age */
++
++u_long source, /* source address */
++ dest, /* destination address */
++ neighbor, /* neighbor router */
++ as_fwd, /* AS_EXT forward address */
++ addrid, /* advertising router id */
++ addaid, /* advertising area id */
++ router, /* advertising router */
++ auth[2], /* authentication type */
++ mask; /* subnet mask (icmp_mask) */
++
++u_char priority, /* OSPF priority */
++ exchange, /* DBD exchange type */
++ rtrtype, /* LSA_RTR type */
++ ooptions; /* OSPF options */
++
++u_int dead_int, /* dead router interval in secs */
++ as_tag, /* AS_EXT tag */
++ seqnum, /* seqnum for LSA */
++ bcastnum, /* num of LSAs to bcast (LSU) */
++ rtrdata, /* LSA_RTR router data */
++ rtrid; /* router id for LSA */
++
+ static ETHERhdr etherhdr;
+ static IPhdr iphdr;
+ static OSPFhdr ospfhdr;
+--- a/src/nemesis-ospf.h
++++ b/src/nemesis-ospf.h
+@@ -35,7 +35,7 @@
+ #include <libnet-1.0.h>
+ #include "nemesis.h"
+
+-u_short id, /* IP id */
++extern u_short id, /* IP id */
+ frag, /* frag shit */
+ mtusize, /* Max dgram length (DBD) */
+ num, /* LSA_RTR num */
+@@ -44,7 +44,7 @@
+ metric, /* OSPF metric */
+ ospf_age; /* OSPF advertisement age */
+
+-u_long source, /* source address */
++extern u_long source, /* source address */
+ dest, /* destination address */
+ neighbor, /* neighbor router */
+ as_fwd, /* AS_EXT forward address */
+@@ -54,20 +54,18 @@
+ auth[2], /* authentication type */
+ mask; /* subnet mask (icmp_mask) */
+
+-u_char priority, /* OSPF priority */
++extern u_char priority, /* OSPF priority */
+ exchange, /* DBD exchange type */
+ rtrtype, /* LSA_RTR type */
+ ooptions; /* OSPF options */
+
+-u_int dead_int, /* dead router interval in secs */
++extern u_int dead_int, /* dead router interval in secs */
+ as_tag, /* AS_EXT tag */
+ seqnum, /* seqnum for LSA */
+ bcastnum, /* num of LSAs to bcast (LSU) */
+ rtrdata, /* LSA_RTR router data */
+ rtrid; /* router id for LSA */
+
+-int mode; /* OSPF injection mode */
+-
+ int buildospf(ETHERhdr *, IPhdr *, FileData *, FileData *, char *);
+
+ #endif /* __NEMESIS_OSPF_H__ */
diff --git a/net-misc/nemesis/nemesis-1.4-r2.ebuild b/net-misc/nemesis/nemesis-1.4-r2.ebuild
new file mode 100644
index 000000000000..e7b2e7d1891e
--- /dev/null
+++ b/net-misc/nemesis/nemesis-1.4-r2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools
+
+DESCRIPTION="A commandline-based, portable human IP stack for UNIX/Linux"
+HOMEPAGE="http://nemesis.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P/_}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~sparc ~x86"
+
+RDEPEND="
+ net-libs/libpcap
+"
+DEPEND="
+ ${RDEPEND}
+ =net-libs/libnet-1.0*
+"
+
+DOCS="CREDITS ChangeLog README"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fileio.patch
+ "${FILESDIR}"/${P}-libnet-1.0.patch
+ "${FILESDIR}"/${P}-prototcp.patch
+)
+
+src_prepare() {
+ default
+for i in src/*.[ch]; do cp -av $i $i.orig || die; done
+ eapply "${FILESDIR}"/${P}-fno-common.patch
+ eautoreconf
+}