I am creating a dhcp client in Linux(Ubuntu). I am creating a udp socket and binding it to port 68 and then call recvfrom. I receive a permission denied bind error. I suspect there is a daemon or process which is already bound to port 68. How do I find it?
+1
A:
Question: Are you root? You must be root to bind to a privileged port (less that 1024).
jkp
2009-11-23 13:42:13
+1
A:
You need to be super user to bind to ports lower than 1024, have you tried running it with sudo?
To find out if something is bound to port 68, do:
sudo netstat -l -u -n -p | grep 68
Puppe
2009-11-23 13:42:19
i thought you connect to server at port 67 and bind the socket to port 68
Bruce
2009-11-23 13:49:51
You're right, I forgot that small detail :)
Puppe
2009-11-23 14:07:25
+1
A:
netstat is your guy for finding all your network connections.
you want something like netstat -l, to display listening endpoints.
Slaftos
2009-11-23 13:48:33