2005-02-08 Paul Jakma <paul@dishone.st>
* ospf_packet.c: (various) Remove unneeded stream_set_putp abuse.
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 67fbedd..341c31b 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -348,7 +348,6 @@
unsigned char digest[OSPF_AUTH_MD5_SIZE];
struct md5_ctx ctx;
void *ibuf;
- unsigned long oldputp;
u_int32_t t;
struct crypt_key *ck;
char *auth_key;
@@ -381,10 +380,7 @@
md5_finish_ctx (&ctx, digest);
/* Append md5 digest to the end of the stream. */
- oldputp = stream_get_putp (op->s);
- stream_set_putp (op->s, ntohs (ospfh->length));
stream_put (op->s, digest, OSPF_AUTH_MD5_SIZE);
- stream_set_putp (op->s, oldputp);
/* We do *NOT* increment the OSPF header length. */
op->length = ntohs (ospfh->length) + OSPF_AUTH_MD5_SIZE;
@@ -2643,7 +2639,7 @@
/* Set Designated Router. */
stream_put_ipv4 (s, DR (oi).s_addr);
- p = s->putp;
+ p = stream_get_putp (s);
/* Set Backup Designated Router. */
stream_put_ipv4 (s, BDR (oi).s_addr);
@@ -2668,10 +2664,7 @@
/* Let neighbor generate BackupSeen. */
if (flag == 1)
- {
- stream_set_putp (s, p);
- stream_put_ipv4 (s, 0);
- }
+ stream_putl_at (s, p, 0); /* ipv4 address, normally */
return length;
}
@@ -2729,8 +2722,7 @@
{
nbr->dd_flags &= ~OSPF_DD_FLAG_M;
/* Set DD flags again */
- stream_set_putp (s, pp);
- stream_putc (s, nbr->dd_flags);
+ stream_putc_at (s, pp, nbr->dd_flags);
}
return length;
}
@@ -2905,10 +2897,7 @@
}
/* Now set #LSAs. */
- stream_set_putp (s, pp);
- stream_putl (s, count);
-
- stream_set_putp (s, s->endp);
+ stream_putl_at (s, pp, count);
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("ospf_make_ls_upd: Stop");