Use inet_pton() for IP Address validation.

It is better to well-known, well-tested version.

Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>