user3647022
user3647022

Reputation: 1

Do we need to bind when using raw socket?

I am using raw socket to pump specific IP Packets to network. I construct the total IP Packet and send using sendto. My question is, what is the need to bind the socket to an IP address, when I am using a raw socket.(Since the source address is filled by the program and not kernel)

Thanks Libin Jose

Upvotes: 0

Views: 425

Answers (1)

Naseef Chowdhury
Naseef Chowdhury

Reputation: 2464

Yes. Binding the socket is must. After binding the socket you will get a port, and the port is the actual medium of the transaction of data.

Upvotes: 0

Related Questions