From: Sean Hefty Date: Tue, 15 Apr 2014 22:25:12 +0000 (-0700) Subject: ibacm: Provide correct addr_len for IPv6 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=f18aa525af47f66b8271e3fae218c1cc082c2ae8;p=~shefty%2Fibacm.git ibacm: Provide correct addr_len for IPv6 When reading in addresses from the address file, the address string is converted into either an IPv4, IPv6, or hostname 'address'. In the case of IPv6, the length of the address is set to the maximum supported value. This can result in extra bytes being set beyond the actual IPv6 address, which are then copied into the endpoint address. Fix this by setting the size of the IPv6 correctly. When the address is copied into the endpoint address, the extra bytes are then ignored. Problem reported by: Kaike Wan Signed-off-by: Sean Hefty --- diff --git a/src/acm.c b/src/acm.c index e5bbfa0..11f89c7 100644 --- a/src/acm.c +++ b/src/acm.c @@ -3376,7 +3376,7 @@ static int acm_assign_ep_names(struct acm_ep *ep) continue; } type = ACM_ADDRESS_IP6; - addr_len = ACM_MAX_ADDRESS; + addr_len = 16; } else { type = ACM_ADDRESS_NAME; addr_len = strlen(name);