Date: Mon, 8 Mar 1999 09:38:35 -0600 From: Chris Costello <chris@holly.dyndns.org> To: CyberPsychotic <fygrave@tigerteam.net> Cc: freebsd-hackers@freebsd.org Subject: Re: SOCK_RAW on BSD Message-ID: <19990308093835.B93344@holly.dyndns.org> In-Reply-To: <Pine.GSO.4.05.9903081847190.9775-100000@kyrnet.kg>; from CyberPsychotic on Mon, Mar 08, 1999 at 06:52:01PM %2B0500 References: <Pine.GSO.4.05.9903081847190.9775-100000@kyrnet.kg>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 8, 1999, CyberPsychotic put this into my mailbox:
> 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).
See below:
>
>
> #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);
if (rdln < 0)
perror("read");
> }
> }
Did you run this as the super-user?
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
>
--
Powered by FreeBSD 4.0-CURRENT. "The Power to Serve!"
Every program in development at MIT expands until it can read mail.
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?19990308093835.B93344>
