summaryrefslogtreecommitdiffstats
path: root/sbin/natd
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-06-13 22:15:42 +0000
committerru <ru@FreeBSD.org>2003-06-13 22:15:42 +0000
commit50a7b0b9b40d5ba0fbc3dd204728fcdb984fe27b (patch)
treec604018f811ea8d801af91aefad245c6cc795202 /sbin/natd
parentdb4799b48402f5e3a4c3e314d70f2ed6c079a3bc (diff)
downloadFreeBSD-src-50a7b0b9b40d5ba0fbc3dd204728fcdb984fe27b.zip
FreeBSD-src-50a7b0b9b40d5ba0fbc3dd204728fcdb984fe27b.tar.gz
If the -proxy_only option is used, the -alias_address/-interface
options are not required. Suggested by: Vaclav Petricek MFC after: 2 weeks
Diffstat (limited to 'sbin/natd')
-rw-r--r--sbin/natd/natd.87
-rw-r--r--sbin/natd/natd.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/sbin/natd/natd.8 b/sbin/natd/natd.8
index a6bf1b6..90f5c13 100644
--- a/sbin/natd/natd.8
+++ b/sbin/natd/natd.8
@@ -315,9 +315,12 @@ will be used as a default.
Use
.Ar address
as the aliasing address.
-If this option is not specified, the
+Either this or the
.Fl interface
-option must be used.
+option must be used (but not both),
+if the
+.Fl proxy_only
+option is not specified.
The specified address is usually the address assigned to the
.Dq public
network interface.
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c
index 38f923f..40f68c2 100644
--- a/sbin/natd/natd.c
+++ b/sbin/natd/natd.c
@@ -169,9 +169,11 @@ int main (int argc, char** argv)
openlog ("natd", LOG_CONS | LOG_PID | (verbose ? LOG_PERROR : 0),
logFacility);
/*
- * Check that valid aliasing address has been given.
+ * If not doing the transparent proxying only,
+ * check that valid aliasing address has been given.
*/
- if (aliasAddr.s_addr == INADDR_NONE && ifName == NULL)
+ if (aliasAddr.s_addr == INADDR_NONE && ifName == NULL &&
+ !(PacketAliasSetMode(0,0) & PKT_ALIAS_PROXY_ONLY))
errx (1, "aliasing address not given");
if (aliasAddr.s_addr != INADDR_NONE && ifName != NULL)
OpenPOWER on IntegriCloud