1 2 3 4 5 6 7 8 9 10
| It is important to understand that SOCK_RAW sockets may get many
unexpected datagrams. For example, a PING program may use SOCK_RAW
sockets to send ICMP echo requests. While the application is expecting ICMP
echo responses, all other ICMP messages (such as ICMP
HOST_UNREACHABLE) may be delivered to this application also. Moreover, if
several SOCK_RAW sockets are open on a computer at the same time, the
same datagrams may be delivered to all the open sockets. An application
must have a mechanism to recognize its datagram and to ignore all others.
Such mechanism may include inspecting the received IP headerusing unique
identifiers in the ICMP header (ProcessID, for example), and so forth. |
Partager