From a6cee69af4c77c9795f57a459ea88d37227b3271 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Thu, 14 Dec 2017 22:40:48 +0000 Subject: [PATCH] Fix exit code from dhcp_release6. --- CHANGELOG | 3 +++ contrib/lease-tools/dhcp_release6.c | 9 ++++++--- debian/changelog | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e435fc8..ae03836 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,9 @@ version 2.79 since these are not secure. This behaviour is mandated in RFC-6944. + Fix incorrect error exit code from dhcp_release6 utility. + Thanks Gaudenz Steinlin for the bug report. + version 2.78 Fix logic of appending "." to PXE basename. Thanks to Chris diff --git a/contrib/lease-tools/dhcp_release6.c b/contrib/lease-tools/dhcp_release6.c index 472a190..7f79fa7 100644 --- a/contrib/lease-tools/dhcp_release6.c +++ b/contrib/lease-tools/dhcp_release6.c @@ -265,7 +265,8 @@ uint16_t parse_iana_suboption(char* buf, size_t len) int16_t parse_packet(char* buf, size_t len) { - uint8_t type = buf[0]; + int16_t ret = -1; + uint8_t type = buf[0]; /*skipping tx id. you need it, uncomment following line uint16_t tx_id = ntohs((buf[1] <<16) + (buf[2] <<8) + buf[3]); */ @@ -293,7 +294,9 @@ int16_t parse_packet(char* buf, size_t len) fprintf(stderr, "Error: %d %s\n", status, option_value); return status; } - + + /* Got success status, return that if there's no specific error in an IA_NA. */ + ret = SUCCESS; } if (option_type == IA_NA ) @@ -306,7 +309,7 @@ int16_t parse_packet(char* buf, size_t len) current_pos += option_len; } - return -1; + return ret; } void usage(const char* arg, FILE* stream) diff --git a/debian/changelog b/debian/changelog index e0d2cf4..f969b4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ dnsmasq (2.79-1) unstable; urgency=low * New upstream. * Fix trust-anchor regex in init script. (closes: #884347) + * Fix exit code for dhcp_release6 (closes: #833596) -- Simon Kelley Tue, 7 Sep 2017 22:47:01 +0000