[sheepdog] Duplicated line at lib/net.c:519

Hitoshi Mitake mitake.hitoshi at gmail.com
Fri Mar 13 16:52:16 CET 2015


On Fri, Mar 13, 2015 at 2:04 PM, Roy Yang <bsdnet at outlook.com> wrote:
> While browsing the source of sheepdog,  seems those two lines are the same:
>
> memcpy(bytes + 12, &sin->sin_addr, 4);
> memcpy(bytes + 12, &sin->sin_addr, 4);
>
> Attached patch is to remove the duplicated line if this is a minor bug.
>
> From 4f5fc977ea12e2048fc025b66fbbeea9c411157d Mon Sep 17 00:00:00 2001
> From: Roy Yang <ryang at ryang-dt.(none)>
> Date: Thu, 12 Mar 2015 21:39:00 -0700
> Subject: [PATCH] Remove the duplicated code line
>
> Signed-off-by: Roy Yang <bsdnet at outlook.com>
> ---
>  lib/net.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

Seems that your change is correct but the style should be changed a
little bit (e.g. placement of commit log). Could you follow the below
guide line?

https://github.com/sheepdog/sheepdog/wiki/Submit-a-patch

Thanks,
Hitoshi

>
> diff --git a/lib/net.c b/lib/net.c
> index 5b34a1c..6e84937 100644
> --- a/lib/net.c
> +++ b/lib/net.c
> @@ -519,7 +519,6 @@ int get_local_addr(uint8_t *bytes)
>                         sin = (struct sockaddr_in *)ifa->ifa_addr;
>                         memset(bytes, 0, 12);
>                         memcpy(bytes + 12, &sin->sin_addr, 4);
> -                       memcpy(bytes + 12, &sin->sin_addr, 4);
>                         sd_notice("found IPv4 address");
>                         goto out;
>                 case AF_INET6:
> --
> 1.7.2.3
>
>
> Cheers,
>
> Roy
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> https://lists.wpkg.org/mailman/listinfo/sheepdog
>



More information about the sheepdog mailing list