Discussion:
[Linuxptp-devel] [PATCH] Fix sk_interface_addr().
Miroslav Lichvar
2014-05-12 16:35:16 UTC
Permalink
This was broken in commit e804e6, ifa_addr is a pointer to sockaddr,
it shouldn't be referenced for the memcpy call.
---
sk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sk.c b/sk.c
index 838004e..f694bbd 100644
--- a/sk.c
+++ b/sk.c
@@ -198,7 +198,7 @@ int sk_interface_addr(const char *name, int family, struct address *addr)
default:
continue;
}
- memcpy(&addr->sa, &i->ifa_addr, addr->len);
+ memcpy(&addr->sa, i->ifa_addr, addr->len);
result = 0;
break;
}
--
1.9.0
Jiri Benc
2014-05-12 16:55:40 UTC
Permalink
Post by Miroslav Lichvar
This was broken in commit e804e6, ifa_addr is a pointer to sockaddr,
it shouldn't be referenced for the memcpy call.
Oh, my fault, sorry for that and thanks for fixing it.

Acked-by: Jiri Benc <***@redhat.com>
--
Jiri Benc
Richard Cochran
2014-05-12 17:17:41 UTC
Permalink
Post by Miroslav Lichvar
This was broken in commit e804e6, ifa_addr is a pointer to sockaddr,
it shouldn't be referenced for the memcpy call.
---
Applied.

Thanks,
Richard

Loading...