summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2001-01-30 04:26:51 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2001-01-30 04:26:51 +0000
commit1a1e454b4bba88f2fa856f317639c83249c18974 (patch)
treeb4aeb0256912a8f7f0c27685c60041d88df0f9a2 /sbin
parent3b92d24a6aca02b8fc77a0d881343191f7728c09 (diff)
reimplement whacked ipnat changes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ipnat/ipnat.c5
-rw-r--r--sbin/ipnat/natparse.c14
2 files changed, 9 insertions, 10 deletions
diff --git a/sbin/ipnat/ipnat.c b/sbin/ipnat/ipnat.c
index 9a3b9db453b..b7a7a50230f 100644
--- a/sbin/ipnat/ipnat.c
+++ b/sbin/ipnat/ipnat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipnat.c,v 1.39 2001/01/17 05:01:01 fgsch Exp $ */
+/* $OpenBSD: ipnat.c,v 1.40 2001/01/30 04:26:49 kjell Exp $ */
/*
* Copyright (C) 1993-2000 by Darren Reed.
@@ -43,7 +43,7 @@
#include <arpa/inet.h>
#include <resolv.h>
#include <ctype.h>
-#include <netinet/ip_compat.h>
+#include <netinet/ip_fil_compat.h>
#include <netinet/ip_fil.h>
#include <netinet/ip_proxy.h>
#include <netinet/ip_nat.h>
@@ -74,6 +74,7 @@ static char thishost[MAXHOSTNAMELEN];
extern char *optarg;
+char *nlistf = NULL, *memf = NULL;
extern ipnat_t *natparse __P((char *, int));
extern void natparsefile __P((int, char *, int));
extern void printnat __P((ipnat_t *, int, void *));
diff --git a/sbin/ipnat/natparse.c b/sbin/ipnat/natparse.c
index fe7716983e0..e72f6adb0fc 100644
--- a/sbin/ipnat/natparse.c
+++ b/sbin/ipnat/natparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: natparse.c,v 1.8 2001/01/23 02:24:12 fgsch Exp $ */
+/* $OpenBSD: natparse.c,v 1.9 2001/01/30 04:26:50 kjell Exp $ */
/*
* Copyright (C) 1993-2000 by Darren Reed.
@@ -41,7 +41,7 @@
#include <arpa/inet.h>
#include <resolv.h>
#include <ctype.h>
-#include <netinet/ip_compat.h>
+#include <netinet/ip_fil_compat.h>
#include <netinet/ip_fil.h>
#include <netinet/ip_proxy.h>
#include <netinet/ip_nat.h>
@@ -318,10 +318,6 @@ int linenum;
return NULL;
}
- /* TCP only by default */
- ipn.in_flags |= IPN_TCP;
- proto = "tcp";
-
cpp++;
strncpy(ipn.in_ifname, *cpp, sizeof(ipn.in_ifname) - 1);
@@ -600,8 +596,10 @@ int linenum;
return NULL;
} else if (genmask("255.255.255.255", (u_32_t *)&ipn.in_inmsk))
return NULL;
- if (*cpp) {
- ipn.in_flags &= ~IPN_TCP; /* override default */
+ if (!*cpp) {
+ ipn.in_flags |= IPN_TCP; /* XXX- TCP only by default */
+ proto = "tcp";
+ } else {
if (!strcasecmp(*cpp, "tcp"))
ipn.in_flags |= IPN_TCP;
else if (!strcasecmp(*cpp, "udp"))