Date: Mon, 8 Mar 1999 18:52:01 +0500 (GMT) From: CyberPsychotic <fygrave@tigerteam.net> To: freebsd-hackers@freebsd.org Subject: SOCK_RAW on BSD Message-ID: <Pine.GSO.4.05.9903081847190.9775-100000@kyrnet.kg>
next in thread | raw e-mail | index | archive | help
Hello people, here I've been playing with RAW sockets on FreeBSD and got stumbled abit. Any ideas why code bellow does't seem to get anything passed by kernel. (I read manual pages and /sys/netinet/raw_ip.c but neither place mention any incompatibilies with other systems. This piece would work fine on Linux platforms). #include <stdio.h> #include <netdb.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> void main(void) { char buf[10000]; int s,rdln; s=socket(AF_INET, SOCK_RAW, IPPROTO_RAW); while(1) { rdln=read(s, buf, 9999); printf("got pack len: %i\n",rdln); } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.05.9903081847190.9775-100000>