Raw sockets problem?

Robert Watson rwatson at freebsd.org
Sat Jan 8 09:30:25 PST 2005


On Sat, 8 Jan 2005, Ivan Voras wrote:

> I've just noticed I can't create a raw socket on 5.3-RELEASE, while the
> same code works on 5.2. I get 'Protocol not supported' error on code
> like this: 

I've not got a 5.2 box on hand, but this appears not to work on 4.x. 
There isn't a domain handler for AF_LINK, so you shouldn't be able to
create a socket of that type, so if it was possible in 5.2, it was likely
a bug.

Robert N M Watson


> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <sys/socket.h>
> #include <errno.h>
> 
> void main() {
>      int sock = socket(AF_LINK, SOCK_RAW, 0);
>      if (sock < 0)
>          printf(strerror(errno));
> }
> 
> Code like this *seems* ok (and I'm sure it worked on 5.2)... why does it 
> fail now?
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
> 



More information about the freebsd-hackers mailing list