summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorpaul <paul>2002-12-13 20:55:25 +0000
committerpaul <paul>2002-12-13 20:55:25 +0000
commit9483e15540359cbd90b3f6481f1a7390a92167a7 (patch)
treed563d465517b55e1cf45b387411b53090ef3402f /ospfd
parent48b33aaf706367aa9d647e2893f974a7f5740a6b (diff)
zebra-ospfd-md5auth-seqnum.patch - paulj - change OSPF md5 sequence number
to be derived from time() to speed up synching after restart of ospfd
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_packet.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 2156ce33..95d184dc 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -321,6 +321,7 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
struct md5_ctx ctx;
void *ibuf;
unsigned long oldputp;
+ u_int32_t t;
struct crypt_key *ck;
char *auth_key;
@@ -332,7 +333,9 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
/* We do this here so when we dup a packet, we don't have to
waste CPU rewriting other headers. */
- ospfh->u.crypt.crypt_seqnum = htonl (oi->crypt_seqnum++);
+ t = (time(NULL) & 0xFFFFFFFF);
+ oi->crypt_seqnum = ( t > oi->crypt_seqnum ? t : oi->crypt_seqnum++);
+ ospfh->u.crypt.crypt_seqnum = htonl (oi->crypt_seqnum);
/* Get MD5 Authentication key from auth_key list. */
if (list_isempty (OSPF_IF_PARAM (oi, auth_crypt)))