<div>this is entry in sad:</div>
<div>sitea:~ # setkey -D<br><a href="http://172.16.1.102">172.16.1.102</a> <a href="http://172.16.1.101">172.16.1.101</a><br> esp mode=transport spi=2311113685(0x89c0cbd5) reqid=16385(0x00004001)<br> E: aes-cbc 5bea7c79 e6341ada 2c43bae9 eae8a0f8
<br> A: hmac-sha1 2bc7ccc3 455162fb 6b2bfee8 a529609b 846305da<br> seq=0x00000000 replay=32 flags=0x00000000 state=mature<br> created: Dec 23 04:33:22 2006 current: Dec 23 09:49:56 2006<br> diff: 18994(s) hard: 0(s) soft: 0(s)
<br> last: hard: 0(s) soft: 0(s)<br> current: 0(bytes) hard: 0(bytes) soft: 0(bytes)<br> allocated: 0 hard: 0 soft: 0<br> sadb_seq=1 pid=15090 refcnt=0<br>
<a href="http://172.16.1.101">172.16.1.101</a> <a href="http://172.16.1.102">172.16.1.102</a><br> esp mode=transport spi=1197392207(0x475ec14f) reqid=16385(0x00004001)<br> E: aes-cbc c65f1b6a 31468378 212a78e5 8e39c5ff
<br> A: hmac-sha1 519ba67c ec0ba420 398ea5a6 1ab50b63 f136b960<br> seq=0x00000000 replay=32 flags=0x00000000 state=mature<br> created: Dec 23 04:33:22 2006 current: Dec 23 09:49:56 2006<br> diff: 18994(s) hard: 0(s) soft: 0(s)
<br> last: hard: 0(s) soft: 0(s)<br> current: 0(bytes) hard: 0(bytes) soft: 0(bytes)<br> allocated: 0 hard: 0 soft: 0<br> sadb_seq=0 pid=15090 refcnt=0<br>
</div>
<div>and this is entry in spd:</div>
<div>sitea:~ # setkey -D -P<br>172.16.1.102[any] 172.16.1.101[any] any<br> in prio high + 1073739744 ipsec<br> esp/transport//unique#16385<br> created: Dec 21 22:33:04 2006 lastused: Dec 21 22:33:47 2006
<br> lifetime: 0(s) validtime: 0(s)<br> spid=464 seq=9 pid=15105<br> refcnt=1<br>172.16.1.101[any] 172.16.1.102[any] any<br> out prio high + 1073739744 ipsec<br> esp/transport//unique#16385
<br> created: Dec 23 04:33:22 2006 lastused:<br> lifetime: 0(s) validtime: 0(s)<br> spid=473 seq=8 pid=15105<br> refcnt=1<br> </div>
<div>i want to know how did the kernel decide which sa to use when a packet matched one of entry in spd if there are many sa.</div>
<div> </div>