net: shell: Add IPv6 and IPv4 checks for ping command
net: shell: Add IPv6 and IPv4 checks for ping command

If IPv6 is disabled, then we can skip IPv6 checks and avoid
Coverity warnings. Same thing for IPv4.

Coverity-CID: 189506
Fixes #11100

Signed-off-by: Jukka Rissanen <f9f077d1da4c7aa947f9864fa5a28c3588f6a45d@linux.intel.com>

nashif/zephyr,finikorg/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,punitvara/zephyr,ldts/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,galak/zephyr,galak/zephyr,nashif/zephyr,punitvara/zephyr,punitvara/zephyr,punitvara/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,finikorg/zephyr,galak/zephyr,nashif/zephyr,finikorg/zephyr,explora26/zephyr,ldts/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,explora26/zephyr,Vudentz/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr