Fix the length of compared data to be the size of the IPv4/IPv6 address.
Signed-off-by: Miroslav Lichvar <[email protected]>
---
util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util.c b/util.c
index 9ad23e0..42c0977 100644
--- a/util.c
+++ b/util.c
@@ -78,12 +78,12 @@ int addreq(enum transport_type type, struct address *a,
struct address *b)
case TRANS_UDP_IPV4:
bufa = &a->sin.sin_addr;
bufb = &b->sin.sin_addr;
- len = sizeof(a->sin);
+ len = sizeof(a->sin.sin_addr);
break;
case TRANS_UDP_IPV6:
bufa = &a->sin6.sin6_addr;
bufb = &b->sin6.sin6_addr;
- len = sizeof(a->sin6);
+ len = sizeof(a->sin6.sin6_addr);
break;
case TRANS_IEEE_802_3:
bufa = &a->sll.sll_addr;
--
2.17.2
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel