]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Check that we were able to turn a packet into a lease.
authorShawn Routhier <sar@isc.org>
Wed, 29 Jul 2015 17:56:26 +0000 (10:56 -0700)
committerShawn Routhier <sar@isc.org>
Wed, 29 Jul 2015 17:56:26 +0000 (10:56 -0700)
Squashed commit of the following:

[rt39279] Check that we were able to turn a packet into a lease.

RELNOTES
client/dhc6.c

index ed310ae93c14fe012b103d3e5ffe199ad224d119..a2486d103f3e88a097cbc9da5756d8363c05899f 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -181,9 +181,9 @@ by Eric Young (eay@cryptsoft.com).
 
 - LDAP Patches - Numerous small patches submitted by contributors have
   been applied to the contributed code which supplies LDAP support.
-  In addition, two larger submissions have also been included.  The 
-  first adds support for IPv6 configuration adn the second provides 
-  GSSAPI authentication.  
+  In addition, two larger submissions have also been included.  The
+  first adds support for IPv6 configuration and the second provides
+  GSSAPI authentication.
   [ISC-Bugs #39056]
   [ISC-Bugs #22742]
   [ISC-Bugs #24449]
@@ -199,6 +199,9 @@ by Eric Young (eay@cryptsoft.com).
   [ISC-Bugs #36774]
   [ISC-Bugs #37876]
 
+- Handle an out of memory condition in the client a bit better.
+  [ISC-Bugs #39279
+
                        Changes since 4.3.2rc2
 - None
 
index 33e35cdf745ee8436f253a7ead77624dcf58a873..093271f93308ed298ea636ba2d816cb0337a8e8b 100644 (file)
@@ -2798,6 +2798,12 @@ init_handler(struct packet *packet, struct client_state *client)
 
        lease = dhc6_leaseify(packet);
 
+       /* Out of memory or corrupt packet condition...hopefully a temporary
+        * problem.  Returning now makes us try to retransmit later.
+        */
+       if (lease == NULL)
+               return;
+
        if (dhc6_check_advertise(lease) != ISC_R_SUCCESS) {
                log_debug("PRC: Lease failed to satisfy.");
                dhc6_lease_destroy(&lease, MDL);
@@ -2915,7 +2921,7 @@ rapid_commit_handler(struct packet *packet, struct client_state *client)
 
        lease = dhc6_leaseify(packet);
 
-       /* This is an out of memory condition...hopefully a temporary
+       /* Out of memory or corrupt packet condition...hopefully a temporary
         * problem.  Returning now makes us try to retransmit later.
         */
        if (lease == NULL)
@@ -3729,7 +3735,7 @@ reply_handler(struct packet *packet, struct client_state *client)
 
        lease = dhc6_leaseify(packet);
 
-       /* This is an out of memory condition...hopefully a temporary
+       /* Out of memory or corrupt packet condition...hopefully a temporary
         * problem.  Returning now makes us try to retransmit later.
         */
        if (lease == NULL)