I have a question with the socket.

The ping in the pingLib.c is done through a

socket (AF_INET, SOCK_RAW, ICMP_PROTO)

There is no bind() used after that.

Can I use bind() to associate this socket with an interface?


NET1 ----NET2 ----port1 unit port2 ----- NET3 ---- NET4

What I want to do is if I use port2 IP with socket, I will be able to
ping NET3 and NET4, but can not ping NET1 and NET2.

Is this possible?

Thanks!

Yong