]> git.puffer.fish Git - mirror/frr.git/commitdiff
[zebra] IRDP: Move stream_free to where its created, probably fixing a leak
authorPaul Jakma <paul.jakma@sun.com>
Fri, 4 Aug 2006 06:18:04 +0000 (06:18 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 4 Aug 2006 06:18:04 +0000 (06:18 +0000)
2006-08-01 Paul Jakma <paul.jakma@sun.com>

* irdp_main.c: (irdp_advertisement) free the stream here, when done,
  right under where it was allocated so it's blindingly obvious
  it's correct. This possibly fixes a very slow leak of streams in
  zebra.
* irdp_packet.c: (send_packet) don't free the stream here as
  it's hard to tell if right, plus an error case seemed to
  returning before free anyway.

zebra/ChangeLog
zebra/irdp_main.c
zebra/irdp_packet.c

index dced6760dd265b2831383b68e091b048a1d6885a..b7f71124df61c3c22c961e38ac96749328ae3c94 100644 (file)
@@ -8,6 +8,16 @@
        * misc_null.c: Must include header files to get older versions of gcc
          to process the #pragma statements properly.
 
+2006-08-01 Paul Jakma <paul.jakma@sun.com>
+
+       * irdp_main.c: (irdp_advertisement) free the stream here, when done,
+         right under where it was allocated so it's blindingly obvious
+         it's correct. This possibly fixes a very slow leak of streams in
+         zebra.
+       * irdp_packet.c: (send_packet) don't free the stream here as
+         it's hard to tell if right, plus an error case seemed to
+         returning before free anyway.
+
 2006-07-27 Paul Jakma <paul.jakma@sun.com>
 
        * {ioctl,kernel}_null.c: Dummy/Null kernel method implementations,
index 04f12f185c9ddb22fe8718dd24bdedb2b439f638..e4e71cf372efa067fbd2a360739e6cd85e96781d 100644 (file)
@@ -224,7 +224,8 @@ static void irdp_advertisement (struct interface *ifp, struct prefix *p)
   struct stream *s;
   s = stream_new (128);
   make_advertisement_packet (ifp, p, s);
-  irdp_send(ifp, p, s); 
+  irdp_send(ifp, p, s);
+  stream_free (s);
 }
 
 int irdp_send_thread(struct thread *t_advert)
index 74c75ab25e5c3c21613da85ae15c88f736d9f1ac..3c5f1559caaf495b4f486451f153ebad637227d6 100644 (file)
@@ -286,7 +286,7 @@ send_packet(struct interface *ifp,
   u_long src;
   int on;
  
-  if (!(ifp->flags & IFF_UP)) 
+  if (!(ifp->flags & IFF_UP))
     return;
 
   if (!p) 
@@ -311,7 +311,6 @@ send_packet(struct interface *ifp,
 
   /* icmp->checksum is already calculated */
   ip->ip_len  = sizeof(struct ip) + stream_get_endp(s);
-  stream_free(s); 
 
   on = 1;
   if (setsockopt(irdp_sock, IPPROTO_IP, IP_HDRINCL,