Check that Host is set in ServerConnection and RouterConnection.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 9 Apr 2003 09:16:01 +0000 (09:16 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 9 Apr 2003 09:16:01 +0000 (09:16 +0000)
apps/silcd/serverconfig.c
doc/example_silcd.conf.in

index e6da9f20ed1bb2d98bdd62c97427a8a42d9dbe5c..40e2bf0a0fabbabb7cd624cf1c0766f4f7c1ee8a 100644 (file)
@@ -984,6 +984,10 @@ SILC_CONFIG_CALLBACK(fetch_server)
     /* check the temporary struct's fields */
     if (!tmp) /* discard empty sub-blocks */
       return SILC_CONFIG_OK;
+    if (!tmp->host) {
+      got_errno = SILC_CONFIG_EMISSFIELDS;
+      goto got_err;
+    }
 
     /* the temporary struct is ok, append it to the list */
     SILC_SERVER_CONFIG_LIST_APPENDTMP(config->servers);
@@ -1047,6 +1051,10 @@ SILC_CONFIG_CALLBACK(fetch_router)
   if (type == SILC_CONFIG_ARG_BLOCK) {
     if (!tmp) /* discard empty sub-blocks */
       return SILC_CONFIG_OK;
+    if (!tmp->host) {
+      got_errno = SILC_CONFIG_EMISSFIELDS;
+      goto got_err;
+    }
 
     SILC_SERVER_CONFIG_LIST_APPENDTMP(config->routers);
     config->tmp = NULL;
index 41426d40497cc96af54d9858257d251fc5784657..20cc25c551330769cbba935001abcc9c4298c048 100644 (file)
@@ -448,7 +448,8 @@ Admin {
 # If server connections are configured it means that this server is
 # router server.  Normal servers must not configure server connections.
 # Thus, if this server is not router do not configure this section.  If
-# your server is router, this must be configured.
+# your server is router, this must be configured.  The Host (mandatory)
+# specifies the remote server.
 #
 # The authentication data is specified by Passphrase and/or PublicKey.
 # If both are provided then both password and public key based authentication
@@ -474,9 +475,9 @@ ServerConnection {
 # For normal servers only one entry maybe configured to this section.  It
 # must be the router this server will be connected to.  For router servers,
 # this section includes all configured router connections.  The first
-# configured connection is the primary route.  The Host specifies the
-# remote hostname or IP address.  The Port specifies the remote port to
-# connect when Initiator is true.  When Initiator is false the Port
+# configured connection is the primary route.  The Host (mandatory) specifies
+# the remote hostname or IP address.  The Port specifies the remote port 
+# to connect when Initiator is true.  When Initiator is false the Port
 # specifies the local port (listener port).
 #
 # The authentication data is specified by Passphrase and/or PublicKey.