This is a quick question for linux c programming raw sockets. If I wanted to just listen to any interface with a raw socket, must I actually bind to an ip address or interface to listen to traffic? From what I understand, I feel like I should be able to just call sock(); and then start recvfrom() traffic. Maybe I’m wrong, but I’ve seen some programs that don’t use it.
Share
You are right, the only thing you will need to do is call
socket()and thenrecvfrom(). Nevertheless be aware of the fact that there are some limitations with listening usingSOCK_RAW.For more details you can read e.g. this.