Fix bug that in Linux, ping function will wait for a very long time.