SOCK_RAW sockets and IPPROTO_AH

Sebastien Petit spe at selectbourse.net
Tue Apr 6 01:15:45 PDT 2004


Unfortunatly, I can't use bpf/pcap solution because I must do some
setsockopts (like IP_MULTICAST_IF, IP_MULTICAST_TTL, IP_MULTICAST_ADD_MEMBER
etc.) and this can't be done on bpf/pcap.
When I'm using IPPROTO_VRRP (ip proto 112), All work fine (and other ip
proto type I think). What is the reason that SOCK_RAW don't work with
IPPROTO_AH (ip proto 51).
For me, it's an IP packet in two cases.

Is there a good way for making a patch with SOCK_RAW, IPPROTO_AH ?

I've found another strange thing in SOCK_RAW with IPPROTO_VRRP (112) and
IP_HDRINCL setted on it. All received packet contains an IP Header with a
bad ip_len. If the packet is 60 bytes long, the ip->ip_len contains 40
bytes. When the packet is 100 bytes long, the ip->ip_len contains 80 bytes.
So there is a difference of 20 bytes. I think that the ip header size is
substract from ip_len by error on the kernel.

What are you think about it ?

Regards,
Sebastien.
-- 
spetit at selectbourse.com
spe at selectbourse.net
FreeVRRPd project http://www.b0l.org/

----- Original Message ----- 
From: <JINMEI Tatuya / $B?@L at C#:H (B <jinmei at isl.rdc.toshiba.co.jp>)>
To: "Sebastien Petit" <spetit at selectbourse.com>
Cc: <freebsd-net at freebsd.org>
Sent: Tuesday, April 06, 2004 4:38 AM
Subject: Re: SOCK_RAW sockets and IPPROTO_AH


> >>>>> On Mon, 5 Apr 2004 15:12:49 +0200,
> >>>>> "Sebastien Petit" <spetit at selectbourse.com> said:
>
> > Hi,
> > Is there a way to receive AH packets in userland with a SOCK_RAW socket
?
> > ie: socket(AF_INET, SOCK_RAW, IPPROTO_AH) ?
> > I found that this socket call doesn't work under FreeBSD. On OpenBSD, it
works but a recvfrom/read doesn't return any AH packets when it was received
on an interface.
>
> > Is there another proper way to receive AH packets in Userland under
FreeBSD ? (bpf/pcap is not a solution because I want to have a socket opened
for multicast join)
>
> Unfortunately, bpf/pcap is the only solution.
>
> JINMEI, Tatuya
> Communication Platform Lab.
> Corporate R&D Center, Toshiba Corp.
> jinmei at isl.rdc.toshiba.co.jp
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
>



More information about the freebsd-net mailing list