Fix the ping4 function

Signed-off-by: Yanbing Du <ydu@redhat.com>