From: Shawn Routhier Date: Wed, 29 Jul 2015 17:56:26 +0000 (-0700) Subject: [master] Check that we were able to turn a packet into a lease. X-Git-Tag: v4_3_3b1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af25ded3457a15f957496f39ed9074f60636878e;p=thirdparty%2Fdhcp.git [master] Check that we were able to turn a packet into a lease. Squashed commit of the following: [rt39279] Check that we were able to turn a packet into a lease. --- diff --git a/RELNOTES b/RELNOTES index ed310ae93..a2486d103 100644 --- 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 diff --git a/client/dhc6.c b/client/dhc6.c index 33e35cdf7..093271f93 100644 --- a/client/dhc6.c +++ b/client/dhc6.c @@ -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)