On Mon, 6 Jan 2003 05:29:04 -0600 (CST) Abdul Basit <basit@basit.cc> wrote: > > Hello, > > i wrote a simple program to use raw sockets and catch all > icmp packets. > > // -- code snipped > > buf = (char*) malloc(sizeof(struct ip)+sizeof(struct icmp)); > > sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); You get only incomming packets that way, use: sockfd = socket(PF_PACKET, SOCK_RAW, ETH_P_IP); and use socket filter or filter it youyself. Marian - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html