Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys pass replay sequence number on sadb_x_sa2 (it's outside ...



details:   https://anonhg.NetBSD.org/src/rev/a32e5bc7b416
branches:  trunk
changeset: 513501:a32e5bc7b416
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Aug 02 12:10:14 2001 +0000

description:
pass replay sequence number on sadb_x_sa2 (it's outside of PF_KEY standard
anyways).

diffstat:

 sys/net/pfkeyv2.h      |   6 +++---
 sys/netkey/key.c       |  17 ++++++++++-------
 sys/netkey/key_debug.c |   8 ++++----
 3 files changed, 17 insertions(+), 14 deletions(-)

diffs (109 lines):

diff -r b9224b538cc0 -r a32e5bc7b416 sys/net/pfkeyv2.h
--- a/sys/net/pfkeyv2.h Thu Aug 02 12:06:08 2001 +0000
+++ b/sys/net/pfkeyv2.h Thu Aug 02 12:10:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pfkeyv2.h,v 1.11 2000/10/03 22:46:21 itojun Exp $      */
+/*     $NetBSD: pfkeyv2.h,v 1.12 2001/08/02 12:10:14 itojun Exp $      */
 /*     $KAME: pfkeyv2.h,v 1.23 2000/10/03 21:38:21 itojun Exp $        */
 
 /*
@@ -213,7 +213,7 @@
   u_int8_t sadb_x_sa2_mode;
   u_int8_t sadb_x_sa2_reserved1;
   u_int16_t sadb_x_sa2_reserved2;
-  u_int32_t sadb_x_sa2_reserved3;
+  u_int32_t sadb_x_sa2_sequence;
   u_int32_t sadb_x_sa2_reqid;
 };
 
@@ -287,7 +287,7 @@
 #define SADB_SATYPE_RIPV2      7
 #define SADB_SATYPE_MIP                8
 #define SADB_X_SATYPE_IPCOMP   9
-#define SADB_X_SATYPE_POLICY   10
+/*#define SADB_X_SATYPE_POLICY 10      obsolete, do not reuse */
 #define SADB_SATYPE_MAX                11
 
 #define SADB_SASTATE_LARVAL   0
diff -r b9224b538cc0 -r a32e5bc7b416 sys/netkey/key.c
--- a/sys/netkey/key.c  Thu Aug 02 12:06:08 2001 +0000
+++ b/sys/netkey/key.c  Thu Aug 02 12:10:14 2001 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: key.c,v 1.45 2001/07/27 04:48:13 itojun Exp $  */
-/*     $KAME: key.c,v 1.182 2001/02/16 23:43:01 thorpej Exp $  */
+/*     $NetBSD: key.c,v 1.46 2001/08/02 12:10:14 itojun Exp $  */
+/*     $KAME: key.c,v 1.203 2001/07/28 03:12:18 itojun Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -354,7 +354,7 @@
 static struct mbuf *key_setsadbident __P((u_int16_t, u_int16_t, caddr_t,
        int, u_int64_t));
 #endif
-static struct mbuf *key_setsadbxsa2(u_int8_t, u_int32_t);
+static struct mbuf *key_setsadbxsa2 __P((u_int8_t, u_int32_t, u_int32_t));
 static struct mbuf *key_setsadbxpolicy __P((u_int16_t, u_int8_t,
        u_int32_t));
 static void *key_newbuf __P((const void *, u_int));
@@ -3148,6 +3148,7 @@
 
                case SADB_X_EXT_SA2:
                        m = key_setsadbxsa2(sav->sah->saidx.mode,
+                                       sav->replay ? sav->replay->count : 0,
                                        sav->sah->saidx.reqid);
                        if (!m)
                                goto fail;
@@ -3420,9 +3421,9 @@
  * set data into sadb_x_sa2.
  */
 static struct mbuf *
-key_setsadbxsa2(mode, reqid)
+key_setsadbxsa2(mode, seq, reqid)
        u_int8_t mode;
-       u_int32_t reqid;
+       u_int32_t seq, reqid;
 {
        struct mbuf *m;
        struct sadb_x_sa2 *p;
@@ -3444,7 +3445,7 @@
        p->sadb_x_sa2_mode = mode;
        p->sadb_x_sa2_reserved1 = 0;
        p->sadb_x_sa2_reserved2 = 0;
-       p->sadb_x_sa2_reserved3 = 0;
+       p->sadb_x_sa2_sequence = seq;
        p->sadb_x_sa2_reqid = reqid;
 
        return m;
@@ -6283,7 +6284,9 @@
        m_cat(result, m);
 
        /* create SA extension */
-       m = key_setsadbxsa2(sav->sah->saidx.mode, sav->sah->saidx.reqid);
+       m = key_setsadbxsa2(sav->sah->saidx.mode,
+                       sav->replay ? sav->replay->count : 0,
+                       sav->sah->saidx.reqid);
        if (!m) {
                error = ENOBUFS;
                goto fail;
diff -r b9224b538cc0 -r a32e5bc7b416 sys/netkey/key_debug.c
--- a/sys/netkey/key_debug.c    Thu Aug 02 12:06:08 2001 +0000
+++ b/sys/netkey/key_debug.c    Thu Aug 02 12:10:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key_debug.c,v 1.15 2001/04/06 11:13:56 wiz Exp $       */
+/*     $NetBSD: key_debug.c,v 1.16 2001/08/02 12:10:15 itojun Exp $    */
 /*     $KAME: key_debug.c,v 1.25 2000/07/24 13:23:12 itojun Exp $      */
 
 /*
@@ -385,9 +385,9 @@
 
        printf("sadb_x_sa2{ mode=%u reqid=%u\n",
            sa2->sadb_x_sa2_mode, sa2->sadb_x_sa2_reqid);
-       printf("  reserved1=%u reserved2=%u reserved3=%u }\n",
-           sa2->sadb_x_sa2_reserved1, sa2->sadb_x_sa2_reserved1,
-           sa2->sadb_x_sa2_reserved1);
+       printf("  reserved1=%u reserved2=%u sequence=%u }\n",
+           sa2->sadb_x_sa2_reserved1, sa2->sadb_x_sa2_reserved2,
+           sa2->sadb_x_sa2_sequence);
 
        return;
 }



Home | Main Index | Thread Index | Old Index