[PATCH] s4: remove ipv6:enabled parameteric option
Andrew Bartlett
abartlet at samba.org
Wed Dec 13 09:05:01 UTC 2017
On Tue, 2017-12-12 at 22:32 +0100, Björn Jacke via samba-technical
wrote:
> this was never disabling ipv6, only v6-only interfaces. This can be achieved
> with the interfaces parameter also if wanted.
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
however next time please do not send patches this way (mailbox directly
to the list) as the list munging causes the commit to be set to samba-
technical unless forced back.
Thanks,
Andrew Bartlett
> Signed-off-by: Bjoern Jacke <bjacke at samba.org>
> ---
> source4/lib/socket/interface.c | 24 ++++++++----------------
> 1 file changed, 8 insertions(+), 16 deletions(-)
>
> diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c
> index 963c0aa..594df1a052 100644
> --- a/source4/lib/socket/interface.c
> +++ b/source4/lib/socket/interface.c
> @@ -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++;
> }
>
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list