]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-02-08 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Tue, 8 Feb 2005 11:29:41 +0000 (11:29 +0000)
committerpaul <paul>
Tue, 8 Feb 2005 11:29:41 +0000 (11:29 +0000)
* ospf_packet.c: (various) Remove unneeded stream_set_putp abuse.

ospfd/ChangeLog
ospfd/ospf_packet.c

index 2f58678136c75b37caa4cf15cc84e9ac4d1f1878..ba418ba59c8395ef280d65d5a89cb7bdb08c9440 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-08 Paul Jakma <paul@dishone.st>
+
+       * ospf_packet.c: (various) Remove unneeded stream_set_putp abuse.
+
 2005-02-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * ospf_packet.c: (ospf_read) Fix bug: must check for state ISM_Down,
index 67fbedd2e23640dc2d6f3c12b5a216074893495c..341c31bdb26d96ed9cc795313aff0a19eb9834ec 100644 (file)
@@ -348,7 +348,6 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
   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 @@ ospf_make_md5_digest (struct ospf_interface *oi, struct ospf_packet *op)
   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 @@ ospf_make_hello (struct ospf_interface *oi, struct stream *s)
   /* 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 @@ ospf_make_hello (struct ospf_interface *oi, struct stream *s)
 
   /* 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 @@ ospf_make_db_desc (struct ospf_interface *oi, struct ospf_neighbor *nbr,
        {
          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 @@ ospf_make_ls_upd (struct ospf_interface *oi, struct list *update, struct stream
     }
 
   /* 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");