3

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Marian
  • 85
  • 1
  • 3

1 Answers1

1

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

Community
  • 1
  • 1
Nikolai Fetissov
  • 82,306
  • 11
  • 110
  • 171