netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IPSEC: on behavior of acquire
@ 2005-04-02  1:25 jamal
  2005-04-02  2:12 ` Herbert Xu
  2005-04-02 14:00 ` Alexey Kuznetsov
  0 siblings, 2 replies; 16+ messages in thread
From: jamal @ 2005-04-02  1:25 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Masahide NAKAMURA
  Cc: psec-tools-devel, netdev, kaber, kuznet, jmorris

Folks,

Theres something wrong in the way acquire works - IMO in both pfkey
and netlink. I asked this before but didnt get satisfactory answer.
Masahide-san and myself have had private exchanges and we are both
unsatisfied with current situation. Theres probably a spec or known good
practise documented somewhere ...

Let me provide some testcases then theorize. The idea is to simulate
a situation where the kernel thinks a km is listening (it could be there
but just non-responsive) or just a scenario where the acquire gets lost.
You need the current events patches to see this.

test1)on one window run setkey -x:

ping -c 1 someDST

-1) packet arrives towards outbound
0) Larval state created
1) one acquire sent.
2) timeout.
3) packet dropped. -ESRCH returned.
4) larval state deleted

So question 1): Shouldnt the return code be -ERESTART to ask
the app to retry?
question 2) Why is there a hardcoding of 1 try only?

ping -c2 someDST
Same as above (Steps -1 to 4) repeated twice
one for each packet sent

ping -c3 DST
Same as above repeated 3 times.

test2) With ip x m (but not setkey).

ping -c 1 DST

-1) packet arrives
0) Larval state created
Loop:
1) one acquire sent.
2) timeout. go to loop.
 
So loop has no way to break. ping is hang waiting.
the only way to break out is by hitting control-c on prompt.
I think ping gets a -ERESTART which i believe is the correct signal?
When you hit control-c Larval state is deleted.

Clearly this is not desirable. We want at some point to give up.
Question: Can we have a configurable max retries (sysctl settable)
for acquire - or does it already exist just not being used? Couldnt
find any staring at the code.

ping -c2/3 DST does not change the above behavior. Ping is hang after
first packet - so it doesnt matter.

The conclusion we reached in our discussion is:
a) -ERESTART is the correct signal to return
b) number of acquire retries should be configurable preferably a system
wide value.

Thoughts?

cheers,
jamal

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2005-04-04 14:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1112405303.1096.37.camel@jzny.localdomain>
2005-04-02  7:10 ` IPSEC: on behavior of acquire Aidas Kasparas
2005-04-02 12:25   ` [Ipsec-tools-devel] " Zilvinas Valinskas
2005-04-02 21:28   ` jamal
2005-04-03  8:28     ` Aidas Kasparas
2005-04-03 14:29       ` jamal
2005-04-03 22:02         ` Aidas Kasparas
2005-04-04 12:33           ` [Ipsec-tools-devel] " jamal
2005-04-04 12:59             ` Aidas Kasparas
2005-04-04 13:09               ` jamal
2005-04-04 14:20                 ` Aidas Kasparas
2005-04-02  1:25 jamal
2005-04-02  2:12 ` Herbert Xu
2005-04-02 14:00 ` Alexey Kuznetsov
2005-04-02 21:42   ` jamal
2005-04-02 21:52     ` Thomas Graf
2005-04-03 15:52     ` Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).