]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
Increase buffer space for inet_ntop from 32 to INET6_ADDRSTRLEN
authorHal Rosenstock <hal@mellanox.com>
Wed, 19 Jun 2013 17:08:20 +0000 (20:08 +0300)
committerSean Hefty <sean.hefty@intel.com>
Fri, 28 Jun 2013 06:03:55 +0000 (23:03 -0700)
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
linux/acme_linux.c
src/acm.c

index 1039645ec9e6665ec23db75a39603696a7c29d69..ef5b10714168cc9420ae9fe21c4c18bc1bac717a 100644 (file)
@@ -149,7 +149,7 @@ int gen_addr_ip(FILE *f)
 {
        struct ifconf *ifc;
        struct ifreq *ifr;
-       char ip[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"];
+       char ip[INET6_ADDRSTRLEN];
        int s, ret, dev_index, i, len;
        uint16_t pkey;
        uint8_t port;
index d37056cdb90b581ed5e2051473f8749502f07eeb..a37ebaa19b35422222906745ffa5a71531934f2a 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -2793,7 +2793,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
        FILE *faddr;
        char *dev_name;
        char s[120];
-       char dev[32], addr[32], pkey_str[8];
+       char dev[32], addr[INET6_ADDRSTRLEN], pkey_str[8];
        uint16_t pkey;
        uint8_t type;
        int port, index = 0;
@@ -2812,7 +2812,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
                if (s[0] == '#')
                        continue;
 
-               if (sscanf(s, "%32s%32s%d%8s", addr, dev, &port, pkey_str) != 4)
+               if (sscanf(s, "%46s%32s%d%8s", addr, dev, &port, pkey_str) != 4)
                        continue;
 
                acm_log(2, "%s", s);