Using Raw Socket for UDP
Dear All,
I am in process of Path MTUD implementation, For that I am using UDP packets for probing purpose(not ICMP packets due to denial of service attack).
Since while sending I need to set the DF bit in IP header, I have to use Raw Socket, because if I go for Datagram Socket, it will give error.
So now I am using the following code,
sock = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
So now I am expecting that I will be able to receive ICMP error messages, as well as UDP packet as a response from corresponding server.
M I on the right direction or there is any chance for further modification.
|