s4: remove ipv6:enabled parameteric option
authorBjörn Jacke <bjacke@samba.org>
Tue, 12 Dec 2017 21:32:09 +0000 (22:32 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 13 Dec 2017 19:34:23 +0000 (20:34 +0100)
this was never disabling ipv6, only v6-only interfaces. This can be achieved
with the interfaces parameter also if wanted.

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/lib/socket/interface.c

index 963c0aac3dc84d1f79ff2755b3056198efa2fba7..594df1a0526cc9d75994b05adbc451bbac4b53ff 100644 (file)
@@ -75,8 +75,7 @@ static struct interface *iface_list_find(struct interface *interfaces,
 /****************************************************************************
 add an interface to the linked list of interfaces
 ****************************************************************************/
-static void add_interface(TALLOC_CTX *mem_ctx, const struct iface_struct *ifs, struct interface **interfaces,
-                         bool enable_ipv6)
+static void add_interface(TALLOC_CTX *mem_ctx, const struct iface_struct *ifs, struct interface **interfaces)
 {
        char addr[INET6_ADDRSTRLEN];
        struct interface *iface;
@@ -94,10 +93,6 @@ static void add_interface(TALLOC_CTX *mem_ctx, const struct iface_struct *ifs, s
                return;
        }
 
-       if (!enable_ipv6 && ifs->ip.ss_family != AF_INET) {
-               return;
-       }
-
        iface = talloc(*interfaces == NULL ? mem_ctx : *interfaces, struct interface);
        if (iface == NULL) 
                return;
@@ -153,8 +148,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
                                const char *token, 
                                struct iface_struct *probed_ifaces, 
                                int total_probed,
-                               struct interface **local_interfaces,
-                               bool enable_ipv6)
+                               struct interface **local_interfaces)
 {
        struct sockaddr_storage ss;
        struct sockaddr_storage ss_mask;
@@ -170,7 +164,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
        for (i=0;i<total_probed;i++) {
                if (gen_fnmatch(token, probed_ifaces[i].name) == 0) {
                        add_interface(mem_ctx, &probed_ifaces[i],
-                                     local_interfaces, enable_ipv6);
+                                     local_interfaces);
                        added = true;
                }
        }
@@ -199,7 +193,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
                for (i=0;i<total_probed;i++) {
                        if (sockaddr_equal((struct sockaddr *)&ss, (struct sockaddr *)&probed_ifaces[i].ip)) {
                                add_interface(mem_ctx, &probed_ifaces[i],
-                                             local_interfaces, enable_ipv6);
+                                             local_interfaces);
                                return;
                        }
                }
@@ -269,7 +263,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
                                        p,
                                        probed_ifaces[i].name));
                                add_interface(mem_ctx, &probed_ifaces[i],
-                                             local_interfaces, enable_ipv6);
+                                             local_interfaces);
                                probed_ifaces[i].netmask = saved_mask;
                                return;
                        }
@@ -291,8 +285,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx,
        ifs.ip = ss;
        ifs.netmask = ss_mask;
        ifs.bcast = ss_bcast;
-       add_interface(mem_ctx, &ifs,
-                     local_interfaces, enable_ipv6);
+       add_interface(mem_ctx, &ifs, local_interfaces);
 }
 
 
@@ -305,7 +298,6 @@ void load_interface_list(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, s
        int i;
        struct iface_struct *ifaces = NULL;
        int total_probed;
-       bool enable_ipv6 = lpcfg_parm_bool(lp_ctx, NULL, "ipv6", "enable", true);
 
        *local_interfaces = NULL;
 
@@ -320,13 +312,13 @@ void load_interface_list(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, s
                }
                for (i=0;i<total_probed;i++) {
                        if (!is_loopback_addr((struct sockaddr *)&ifaces[i].ip)) {
-                               add_interface(mem_ctx, &ifaces[i], local_interfaces, enable_ipv6);
+                               add_interface(mem_ctx, &ifaces[i], local_interfaces);
                        }
                }
        }
 
        while (ptr && *ptr) {
-               interpret_interface(mem_ctx, *ptr, ifaces, total_probed, local_interfaces, enable_ipv6);
+               interpret_interface(mem_ctx, *ptr, ifaces, total_probed, local_interfaces);
                ptr++;
        }