[DRBD-user] drbd local replication with remote replication at the same time

莊凱傑 kcchuang.white at gmail.com
Tue Jun 18 04:06:35 CEST 2019


Hi drbd-user,

I have another patch for the same functionality. Please ignore previous
patch.
diff --git a/user/v9/drbdadm_parser.c b/user/v9/drbdadm_parser.c
index 18019c0..c7d3616 100644
--- a/user/v9/drbdadm_parser.c
+++ b/user/v9/drbdadm_parser.c
@@ -720,7 +720,7 @@ static void __parse_address(struct d_address *a)
        a->port = yylval.txt;
        range_check(R_PORT, "port", yylval.txt);

-       a->is_local_address = addr_scope_local(a->addr);
+       a->is_local_address = addr_scope_local(a->addr) ?
addr_scope_local(a->addr) : have_ip(a->af, a->addr);
 }

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
不含病毒。www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

莊凱傑 <kcchuang.white at gmail.com> 於 2019年6月14日 週五 下午6:41寫道:

> Hi drbd-user,
>
> I made some code changes for achieving local and remote replication at the
> same time. Any idea is appreciated.
>
> Previously I sent a local replication problem email, actually I want to
> achieve the goal of drbd local replication with remote replication at the
> same time.
> I look into the patch f0b6e32, in this patch drbdadm is designed allowing
> loopback ip(127.0.0.1) replication by skipping loopback ip check. Hence
> local replication is not a problem now.
>
> I want to achieve local replication with remote replication at the same
> time. And the function check_addr_conflict still disallow the local host
> ip(except for 127.0.0.1) sharing. Hence I'm wondering if we can allow local
> other ip sharing as well as follows:
> diff --git a/user/shared/shared_tool.c b/user/shared/shared_tool.c
> index cdfe9e4..ca17b49 100644
> --- a/user/shared/shared_tool.c
> +++ b/user/shared/shared_tool.c
> @@ -484,9 +484,15 @@ bool addr_scope_local(const char *input)
>         struct in6_addr addr6;
>
>         if (inet_pton(AF_INET6, input, &addr6) == 1)
> -               return IN6_IS_ADDR_LOOPBACK(&addr6);
> +              if (have_ip_ipv6(input) == 1)
> +                       return true;
> +              else
> +                        return IN6_IS_ADDR_LOOPBACK(&addr6);
>         else if (inet_pton(AF_INET, input, &addr4) == 1)
> -               return IN_IS_ADDR_LOOPBACK(&addr4);
> +              if (have_ip_ipv4(input) == 1)
> +                       return true;
> +              else
> +                       return IN_IS_ADDR_LOOPBACK(&addr4);
>
>         return false;
>  }
>
> After the above changes, I hope the r0.res and r0-local.res(as attached)
> will be bought up successfully. As you can see in r0.res, I hope local and
> remote replication being bought up at the same time.
>
> --
> 謝謝
> Kevin
>


-- 
謝謝
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20190618/92dd802f/attachment.htm>


More information about the drbd-user mailing list