Dear tcpdump workers,
I am working on Reh Hat Linux 6.2
I have a process listening on udp port P, I am writing another programm in C
to listen on the same udp port P in a unicast fashion. I have used
int optval =1;
setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *) &optval, sizeof(optval)))
<0);
But execution gives the following error: address already in use
I have read with: man 7 socket
in paragraph SO_REUSEADDR that
with SO_REUSEADDR a socket may bind, except when there is an active
listening socket bound to the address. When the listening socket is bound to
INADDR_ANY with a specific port then it is not possible to bind to this
port.
But I can listen on the same udp port P using the following tcpdump command:
/usr/sbin/tcpdump udp port P
tcpdump can listen on this port while there is another active loistening
socket on the same port P.
I would like to hnow how to bind and then listen on a udp port P, while
there is another active socket on the same port.
thank you for your help
best regards
LI Jiang
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe