netdev
[Top] [All Lists]

[PFKEY] spirange should be in host byte order

To: kuznet@xxxxxxxxxxxxx, davem@xxxxxxxxxx, jmorris@xxxxxxxxxx, netdev@xxxxxxxxxxx
Subject: [PFKEY] spirange should be in host byte order
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 31 Jul 2004 20:04:44 +1000
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040523i
Hi:

I'm looking through the xfrm_alloc_spi stuff and noticed that the
netlink alloc_spi function takes the range in host order while the
PFKEY alloc_spi function takes them in network order.

First I thought that I stuffed up since I was the one who changed
the code in the netlink interface to take them in host order :)

But reading RFC 2367 seems to indicate otherwise.  It says that all
fields are host order unless specified otherwise.  And the spirange
fields are not specified to be network order at all.

Looking at the existing PFKEY users:

User Space
----------
Openswan - Doesn't use PFKEY for this.
Racoon - Puts zeros in there so it doesn't care.  However its test-pfkey
         program stores things in host order.
ISAKMPD - Stores things in host order.

So the conclusion is that we can and should change our PFKEY
implementation to use host order for these fields.

This patch does exactly that.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Attachment: p
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>