Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ICMP Host-Unreachable

Tags:

c

port

sockets

icmp

How do I know if I got an ICMP Host Unreachable after trying to send some data to a UDP port ? I want to check for opened UDP ports on a machine.

like image 871
Marian Avatar asked Dec 04 '25 00:12

Marian


1 Answers

Use connect(2) - you'll get an error on the second send, see more about connected UDP sockets.

like image 105
Nikolai Fetissov Avatar answered Dec 06 '25 14:12

Nikolai Fetissov