On Sunday 29 May 2005 20:38, kulkarni abhi wrote: > Hi All, > We are working on packet filter.I am attaching > filter.c which actually does the packet filtering. > Everything is working fine except the filter for > ports. > We are testing a simple tcpclient and tcpserver (echo > server). > Server is running on 10000 port. > But in packet filter we always get some 4135 port but > not > 10000. Ports are store in the TCP header in network order (big endian). You need to use ntohs() when reading the ports from the TCP header and comparing them with constants like 21, 80, etc. tavi -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/