]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
ibacm: Provide correct addr_len for IPv6
authorSean Hefty <sean.hefty@intel.com>
Tue, 15 Apr 2014 22:25:12 +0000 (15:25 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 16 Apr 2014 06:33:29 +0000 (23:33 -0700)
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 <kaike.wan@intel.com>

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm.c

index e5bbfa04828e66872078bb75b59dbe3cccaa0818..11f89c776e6c56306653ce9c811be96da250f073 100644 (file)
--- 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);