Discussion:
fast_ipsec and ipv6 : next step
(too old to reply)
DEGROOTE Arnaud
2006-10-16 19:28:51 UTC
Permalink
Hi everyone

I continue my work on the fast_ipsec implementation for ipv6. To
understand my problem, I give a little overview of fast_ipsec processing of
a ipv6 packet.

ip6_output
create exthdr if necessary
check policy
split the header if it is necessary
check about jumbo frame
chain exthdr if necessary
play with routing extension header if necessary
ipsec6_process_packet if necessary ( in this case, the job is finished
for this call )

lots of other stuff if we don't process the packet


ipsec_process_packet will encrypt the packet using opencrypto when the
process is done, the packet is reinjected in ip6_output with dummy
argument.

The approch is ok for basic packet ( without extension headers, no mobility
options, etc ... ). In other case, it isn't correct. Calling ip6_output
with the good argument is not really hard, I can just add a callback
parameter to ipsec6_process_packet.

The question is how to handle the second call to ip6_output. If we just
call ip6_output, exthdr will be processed two times and the packet will be
incorrect. I see two possible options and I want your opinions about it :
- cut ip6_output in two functions : the first before the ipsec
processing, the secund is after the ipsec processing. In the case
where there is no ipsec, the penalty is just an extra function
call

- add a possible flag IPV6_REENTRANT. If this flag is set, we
skip all the exthdr processing before ipsec processing.

In both case, I will write a function which can retrieve exthdr from a
mbuf, so when we come back in ip6_output, I can retrieve the exthdrs if
there are any.

Can you comment this ideas or give me some better ideas. I will listen for
any solution. Thanks a lot for your help.

PS : please CC me on reply
--
Degroote Arnaud
ENSEIRB Informatique
***@enseirb.fr

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
DEGROOTE Arnaud
2006-10-21 21:22:19 UTC
Permalink
I've tried to split the ip6_output function. The change is available
here
http://netbsd-soc.cvs.sourceforge.net/netbsd-soc/ipsec6/sys/netinet6/ip6_output.c?view=log

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2006-10-22 03:28:44 UTC
Permalink
Post by DEGROOTE Arnaud
I've tried to split the ip6_output function. The change is available
here
http://netbsd-soc.cvs.sourceforge.net/netbsd-soc/ipsec6/sys/netinet6/ip6_output.c?view=log
Looks ok to me.

christos


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
YAMAMOTO Takashi
2006-10-22 04:17:38 UTC
Permalink
Post by DEGROOTE Arnaud
I've tried to split the ip6_output function. The change is available
here
http://netbsd-soc.cvs.sourceforge.net/netbsd-soc/ipsec6/sys/netinet6/ip6_output.c?view=log
i'm not sure if i like passing these structures by-value,
esp. in a critical path like this.

YAMAMOTO Takashi

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
DEGROOTE Arnaud
2006-10-22 18:43:10 UTC
Permalink
Post by YAMAMOTO Takashi
Post by DEGROOTE Arnaud
I've tried to split the ip6_output function. The change is available
here
http://netbsd-soc.cvs.sourceforge.net/netbsd-soc/ipsec6/sys/netinet6/ip6_output.c?view=log
i'm not sure if i like passing these structures by-value,
esp. in a critical path like this.
I ask myself the question if I must pass exthdr and finaldst by value or
not. I have followed your advice. You can retrieve the code on the same
url.

I have done a similar job for ip_output. It will be nice if you can review
the code too.

Thanks to all.
--
Degroote Arnaud
ENSEIRB Informatique
***@enseirb.fr

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
DEGROOTE Arnaud
2006-10-21 22:34:01 UTC
Permalink
Sorry my last mail was not complet and it seems to be a bit rude. Please
excuse me.

Can someone can review the proposed change and give me this advice about
this change. Is it acceptable for the common patch code ? Any drawbacks ?
...

For information, the goal is here to have two functions for ipv6 output,
one before ipsec processing, the secund after so I can write something like
this :

ip6_output
ipsec6_process_packet
....
ipsec_process_done
ip6_output_cb
ip6_output2

Take cares.
--
Degroote Arnaud
ENSEIRB Informatique
***@enseirb.fr

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...