Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written a udp server which receives client requests using a recvfrom() socket system call, this call receives requests from localhost only, no remote host requests are seen by the recvfrom() call. I tried capturing packets on the receivng port and I can see the packets coming from remote server, but the request don't reach recvfrom(), what could be the matter?

share|improve this question
You're probably only listening on localhost. Impossible to tell without seeing your code, or the output of netstat -an | grep the_port_you_use. – Mat Nov 11 '11 at 9:28
@Mat I have two different sockets listening on the same port (one for TCP and one for UDP) tcp 0 0* LISTEN 31196/agentd udp 0 0* 31196/agentd – Akbar Nov 11 '11 at 10:16
Already checked firewall configurations? "Seeing" packets with tcpdump doesn't mean that they pass a firewall if one is active. – ktf Nov 11 '11 at 10:59
Right, solved, firewall is blocking the udp packets. But I dont see any problem with TCP packets even though the firewall is running. Thanks #ktf – Akbar Nov 14 '11 at 6:06

Check to make sure a firewall isn't active. tcpdump can see packets as they arrive on an interface, before a firewall has processed and dropped them

(Adapted from ktf's comment)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.