security/ipguard: fix build with -fno-common

This commit is contained in:
tb 2021-02-21 09:54:55 +00:00
parent 8372a72b46
commit 219e04f97c
3 changed files with 105 additions and 9 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.18 2019/07/12 20:49:03 sthen Exp $
# $OpenBSD: Makefile,v 1.19 2021/02/21 09:54:55 tb Exp $
COMMENT = protect LAN IP address space by ARP spoofing
DISTNAME = ipguard-1.04
CATEGORIES = security
REVISION = 2
REVISION = 3
HOMEPAGE = http://ipguard.deep.perm.ru/
MASTER_SITES = ${HOMEPAGE}files/

View File

@ -1,7 +1,43 @@
$OpenBSD: patch-ipguard_c,v 1.3 2012/03/30 07:24:45 ajacoutot Exp $
--- ipguard.c.orig Mon Jul 12 00:46:36 2010
+++ ipguard.c Thu Mar 22 11:36:33 2012
@@ -75,6 +75,7 @@ int main(int argc, char *argv[]) {
$OpenBSD: patch-ipguard_c,v 1.4 2021/02/21 09:54:55 tb Exp $
Index: ipguard.c
--- ipguard.c.orig
+++ ipguard.c
@@ -29,6 +29,34 @@
#include "ipguard.h"
+char iface[IFNAMSIZ];
+char ethers_name[PATH_MAX];
+char log_name[PATH_MAX];
+char pid_name[PATH_MAX];
+char fmac[18];
+char pcapf[PCAPFSIZ];
+char suser[MAXLOGNAME];
+int ethers_update;
+int fake_regen;
+int fake_num;
+int fake_time;
+int buffer_num;
+int addr_nosubst;
+int nofirst;
+int grant;
+int read_only;
+int duplex;
+int fixbc;
+int hidden;
+int promisc;
+int debug;
+int verbose;
+
+unsigned int all, good, grat, wgrat, zmac, zip, bad, bmac, bsip, btip,
+ bnew, bgrat, mymac, fake, pfake, nzh, nbe, mis;
+char pfmac[18];
+char s[128+1];
+
void usage(char *name) {
fprintf(stdout, "%s v%s (c) %s <%s>\n\n", NAME, VERSION, AUTHOR, MAIL);
fprintf(stdout, "usage: %s [-h] [-ajgrxziovd]\n", name);
@@ -75,6 +103,7 @@ int main(int argc, char *argv[]) {
srand((unsigned int) getpid());
iface[0] = fmac[0] = pfmac[0] = pcapf[0] = log_name[0] = pid_name[0] = suser[0] = '\0';

View File

@ -1,6 +1,7 @@
$OpenBSD: patch-ipguard_h,v 1.3 2012/03/30 07:24:45 ajacoutot Exp $
--- ipguard.h.orig Mon Jul 12 00:46:36 2010
+++ ipguard.h Thu Mar 22 11:35:20 2012
$OpenBSD: patch-ipguard_h,v 1.4 2021/02/21 09:54:55 tb Exp $
Index: ipguard.h
--- ipguard.h.orig
+++ ipguard.h
@@ -52,8 +52,8 @@
#define MAIL "sead at deep.perm.ru"
@ -12,3 +13,62 @@ $OpenBSD: patch-ipguard_h,v 1.3 2012/03/30 07:24:45 ajacoutot Exp $
#define FAKEMAC "de:ad:xx:xx:xx:xx"
#define PCAPFSIZ 128
@@ -68,33 +68,33 @@
#define NOTICE 3
#define INFO 4
-char iface[IFNAMSIZ];
-char ethers_name[PATH_MAX];
-char log_name[PATH_MAX];
-char pid_name[PATH_MAX];
-char fmac[18];
-char pcapf[PCAPFSIZ];
-char suser[MAXLOGNAME];
-int ethers_update;
-int fake_regen;
-int fake_num;
-int fake_time;
-int buffer_num;
-int addr_nosubst;
-int nofirst;
-int grant;
-int read_only;
-int duplex;
-int fixbc;
-int hidden;
-int promisc;
-int debug;
-int verbose;
+extern char iface[IFNAMSIZ];
+extern char ethers_name[PATH_MAX];
+extern char log_name[PATH_MAX];
+extern char pid_name[PATH_MAX];
+extern char fmac[18];
+extern char pcapf[PCAPFSIZ];
+extern char suser[MAXLOGNAME];
+extern int ethers_update;
+extern int fake_regen;
+extern int fake_num;
+extern int fake_time;
+extern int buffer_num;
+extern int addr_nosubst;
+extern int nofirst;
+extern int grant;
+extern int read_only;
+extern int duplex;
+extern int fixbc;
+extern int hidden;
+extern int promisc;
+extern int debug;
+extern int verbose;
-unsigned int all, good, grat, wgrat, zmac, zip, bad, bmac, bsip, btip,
+extern unsigned int all, good, grat, wgrat, zmac, zip, bad, bmac, bsip, btip,
bnew, bgrat, mymac, fake, pfake, nzh, nbe, mis;
-char pfmac[18];
-char s[128+1];
+extern char pfmac[18];
+extern char s[128+1];
/* ethers.c
*/