Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
3  
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 0.0.0.0:32000 0.0.0.0:* LISTEN 31196/agentd udp 0 0 0.0.0.0:32000 0.0.0.0:* 31196/agentd –  Akbar Nov 11 '11 at 10:16
1  
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.