]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:libsocket: better diagnostics for no interfaces
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 7 Feb 2025 00:37:37 +0000 (13:37 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 26 Aug 2025 22:42:39 +0000 (22:42 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
source4/lib/socket/interface.c

index 65543c6a294c82f4e7e6e97933b40bd1acd4eb06..4899ef69b9f8f5f70dc486cf41840963e4600b45 100644 (file)
@@ -331,8 +331,13 @@ void load_interface_list(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, s
                ptr++;
        }
 
-       if (!*local_interfaces) {
-               DEBUG(0,("WARNING: no network interfaces found\n"));
+       if (*local_interfaces == NULL) {
+               const char **first_ptr = lpcfg_interfaces(lp_ctx);
+               if (first_ptr != NULL && *first_ptr != NULL) {
+                       DBG_ERR("None of the interfaces listed in smb.conf "
+                               "'interfaces = ...' seem to exist\n");
+               }
+               DBG_ERR("WARNING: no network interfaces found\n");
        }
        talloc_free(ifaces);
 }
@@ -356,7 +361,7 @@ int iface_list_count(struct interface *ifaces)
 const char *iface_list_n_ip(struct interface *ifaces, int n)
 {
        struct interface *i;
-  
+
        for (i=ifaces;i && n;i=i->next)
                n--;