diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-02-05 17:33:09 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-02-05 17:33:09 +0000 |
commit | 7d491318b6be7699dfa85a4c5891367153acd85d (patch) | |
tree | add056609f193e18d74affccef9474ced4211650 /sbin | |
parent | 660df56eb862e33850f6274287568a2cf95961a5 (diff) |
Restore change from revision 1.8 that got lost in last commit.
Set default proto earlier enough so service names may be used as well as numbers
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipnat/natparse.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/ipnat/natparse.c b/sbin/ipnat/natparse.c index e72f6adb0fc..4f2c85078ea 100644 --- a/sbin/ipnat/natparse.c +++ b/sbin/ipnat/natparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: natparse.c,v 1.9 2001/01/30 04:26:50 kjell Exp $ */ +/* $OpenBSD: natparse.c,v 1.10 2001/02/05 17:33:08 millert Exp $ */ /* * Copyright (C) 1993-2000 by Darren Reed. @@ -318,6 +318,10 @@ 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); @@ -596,10 +600,8 @@ 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; /* XXX- TCP only by default */ - proto = "tcp"; - } else { + if (*cpp) { + ipn.in_flags &= ~IPN_TCP; /* override default */ if (!strcasecmp(*cpp, "tcp")) ipn.in_flags |= IPN_TCP; else if (!strcasecmp(*cpp, "udp")) |