Conditional check for ICMP to prevent ICMP ping in case of any non supported input

1) Adding conditional check for ICMP to prevent ICMP ping in case
    of any non supported input
2) Modified condition for type verification