Fix the ping4 function

Signed-off-by: Yanbing Du <ydu@redhat.com>
Merge pull request #1571 from will-Do/ping_fix

Fix the ping4 function