forked from Mirror/frr
lib: switch str2prefix_ipv4() to use inet_pton()
This is the second part of commit 8d92004979
, which converted
only one of the two calls to inet_aton().
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
681b22affa
commit
ef231ac76c
|
@ -881,8 +881,10 @@ int str2prefix_ipv4(const char *str, struct prefix_ipv4 *p)
|
|||
cp = XMALLOC(MTYPE_TMP, (pnt - str) + 1);
|
||||
memcpy(cp, str, pnt - str);
|
||||
*(cp + (pnt - str)) = '\0';
|
||||
ret = inet_aton(cp, &p->prefix);
|
||||
ret = inet_pton(AF_INET, cp, &p->prefix);
|
||||
XFREE(MTYPE_TMP, cp);
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
|
||||
/* Get prefix length. */
|
||||
plen = (uint8_t)atoi(++pnt);
|
||||
|
|
Loading…
Reference in a new issue