ping: Fix aliasing violations

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>