From: Shawn Routhier Date: Fri, 25 Apr 2014 17:50:24 +0000 (-0700) Subject: [master] Several small patches X-Git-Tag: v4_3_1b1~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38c4774a4324a16f0a9f39950700699949acb362;p=thirdparty%2Fdhcp.git [master] Several small patches Tidy up several small tickets Correct parsing of DUID from config file, previously the LL type was put in the wrong place in the DUID string. [ISC-Bugs #20962] Add code to parse "do-forward-updates" as well as "do-forward-update" [ISC-Bugs #31328] Remove log_priority as it isn't currently used. [ISC-Bugs #33397] Increase the size of the buffer used for reading interface information. [ISC-Bugs #34858] --- diff --git a/RELNOTES b/RELNOTES index 2b20b5bd9..913f7a548 100644 --- a/RELNOTES +++ b/RELNOTES @@ -54,6 +54,17 @@ by Eric Young (eay@cryptsoft.com). Changes since 4.3.0 +- Tidy up several small tickets + Correct parsing of DUID from config file, previously the LL type + was put in the wrong place in the DUID string. + [ISC-Bugs #20962] + Add code to parse "do-forward-updates" as well as "do-forward-update" + Thanks to Jiri Popelka at Red Hat. + [ISC-Bugs #31328] + Remove log_priority as it isn't currently used. + [ISC-Bugs #33397] + Increase the size of the buffer used for reading interface information. + [ISC-Bugs #34858] Changes since 4.3.0rc1 diff --git a/common/conflex.c b/common/conflex.c index ff46b1411..2e708dabc 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -888,6 +888,9 @@ intern(char *atom, enum dhcp_token dfv) { if (!strcasecmp(atom + 7, "list")) return DOMAIN_LIST; } + if (!strcasecmp (atom + 1, "o-forward-updates")) + return DO_FORWARD_UPDATE; + /* do-forward-update is included for historical reasons */ if (!strcasecmp (atom + 1, "o-forward-update")) return DO_FORWARD_UPDATE; if (!strcasecmp (atom + 1, "ebug")) diff --git a/common/discover.c b/common/discover.c index 4b40a70ae..aeb2fc50b 100644 --- a/common/discover.c +++ b/common/discover.c @@ -29,6 +29,9 @@ #include "dhcpd.h" +/* length of line we can read from the IF file, 256 is too small in some cases */ +#define IF_LINE_LENGTH 1024 + #define BSD_COMP /* needed on Solaris for SIOCGLIFNUM */ #include #include @@ -408,7 +411,7 @@ struct iface_info { */ int begin_iface_scan(struct iface_conf_list *ifaces) { - char buf[256]; + char buf[IF_LINE_LENGTH]; int len; int i; @@ -481,7 +484,7 @@ begin_iface_scan(struct iface_conf_list *ifaces) { */ static int next_iface4(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { - char buf[256]; + char buf[IF_LINE_LENGTH]; int len; char *p; char *name; @@ -605,7 +608,7 @@ next_iface4(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { */ static int next_iface6(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { - char buf[256]; + char buf[IF_LINE_LENGTH]; int len; char *p; char *name; diff --git a/common/parse.c b/common/parse.c index d86a1f957..38d350f4e 100644 --- a/common/parse.c +++ b/common/parse.c @@ -5564,10 +5564,10 @@ int parse_warn (struct parse *cfile, const char *fmt, ...) lexbuf [lix] = 0; #ifndef DEBUG - syslog (log_priority | LOG_ERR, "%s", mbuf); - syslog (log_priority | LOG_ERR, "%s", cfile -> token_line); + syslog (LOG_ERR, "%s", mbuf); + syslog (LOG_ERR, "%s", cfile -> token_line); if (cfile -> lexchar < 81) - syslog (log_priority | LOG_ERR, "%s^", lexbuf); + syslog (LOG_ERR, "%s^", lexbuf); #endif if (log_perror) { diff --git a/includes/omapip/omapip_p.h b/includes/omapip/omapip_p.h index 30a778eda..788c91e68 100644 --- a/includes/omapip/omapip_p.h +++ b/includes/omapip/omapip_p.h @@ -278,7 +278,6 @@ OMAPI_ARRAY_TYPE_DECL(omapi_connection, omapi_connection_object_t); isc_result_t omapi_handle_clear(omapi_handle_t); -extern int log_priority; extern int log_perror; extern void (*log_cleanup) (void); diff --git a/omapip/errwarn.c b/omapip/errwarn.c index 4b3d353d6..7c91d9d32 100644 --- a/omapip/errwarn.c +++ b/omapip/errwarn.c @@ -43,7 +43,6 @@ int log_perror = -1; #else int log_perror = 1; #endif -int log_priority; void (*log_cleanup) (void); #define CVT_BUF_MAX 1023 @@ -66,7 +65,7 @@ void log_fatal (const char * fmt, ... ) va_end (list); #ifndef DEBUG - syslog (log_priority | LOG_ERR, "%s", mbuf); + syslog (LOG_ERR, "%s", mbuf); #endif /* Also log it to stderr? */ @@ -105,7 +104,7 @@ int log_error (const char * fmt, ...) va_end (list); #ifndef DEBUG - syslog (log_priority | LOG_ERR, "%s", mbuf); + syslog (LOG_ERR, "%s", mbuf); #endif if (log_perror) { @@ -132,7 +131,7 @@ int log_info (const char *fmt, ...) va_end (list); #ifndef DEBUG - syslog (log_priority | LOG_INFO, "%s", mbuf); + syslog (LOG_INFO, "%s", mbuf); #endif if (log_perror) { @@ -159,7 +158,7 @@ int log_debug (const char *fmt, ...) va_end (list); #ifndef DEBUG - syslog (log_priority | LOG_DEBUG, "%s", mbuf); + syslog (LOG_DEBUG, "%s", mbuf); #endif if (log_perror) { diff --git a/server/confpars.c b/server/confpars.c index 352b6a6c5..a8fe1fb4e 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -5951,7 +5951,7 @@ parse_server_duid_conf(struct parse *cfile) { } duid.data = (unsigned char *)duid.buffer->data; putUShort(duid.buffer->data, DUID_LL); - putULong(duid.buffer->data + 2, ll_type); + putUShort(duid.buffer->data + 2, ll_type); memcpy(duid.buffer->data + 4, ll_addr.data, ll_addr.len); @@ -6015,7 +6015,7 @@ parse_server_duid_conf(struct parse *cfile) { } duid.data = (unsigned char *)duid.buffer->data; putUShort(duid.buffer->data, DUID_LLT); - putULong(duid.buffer->data + 2, ll_type); + putUShort(duid.buffer->data + 2, ll_type); putULong(duid.buffer->data + 4, llt_time); memcpy(duid.buffer->data + 8, ll_addr.data, ll_addr.len);