- snprintf(x->agentIPStr, SFLOW_MAX_AGENTIP_STRLEN,
- "%04x:%04x:%04x:%04x",
- x->agentAddr.a.ip6[0],
- x->agentAddr.a.ip6[1],
- x->agentAddr.a.ip6[2],
- x->agentAddr.a.ip6[3]);
+ char ipstr[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, (const void *) &x->agentAddr.a.ip6,
+ ipstr, INET6_ADDRSTRLEN);
+ snprintf(x->agentIPStr, sizeof x->agentIPStr, "[%s]", ipstr);