]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Several small patches
authorShawn Routhier <sar@isc.org>
Fri, 25 Apr 2014 17:50:24 +0000 (10:50 -0700)
committerShawn Routhier <sar@isc.org>
Fri, 25 Apr 2014 17:50:24 +0000 (10:50 -0700)
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]

RELNOTES
common/conflex.c
common/discover.c
common/parse.c
includes/omapip/omapip_p.h
omapip/errwarn.c
server/confpars.c

index 2b20b5bd9076043f39ca5a14bf203cc36292836c..913f7a5480b3079a0ff5e55932588a13b9489290 100644 (file)
--- 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
 
index ff46b1411cfa03f8754e9050b8ae88e478876af3..2e708dabc65f4b4736628c800ddd10ec9c74a730 100644 (file)
@@ -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"))
index 4b40a70ae3881ef9168d767977c30f466fdb9541..aeb2fc50ba34d163859eff90a1389a3c64bd7c82 100644 (file)
@@ -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 <sys/ioctl.h>
 #include <errno.h>
@@ -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;
index d86a1f9572bf8955f37156a2d8abb73ff6e8202e..38d350f4e76c5aa74937bc3695f9c2a61cefb0d5 100644 (file)
@@ -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) {
index 30a778eda70ad441655913e5bb617497b5398e84..788c91e68ce59416c20da4f197d8504604c467f0 100644 (file)
@@ -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);
 
index 4b3d353d6b6de0f8770cbaa4c749067452693a09..7c91d9d32a8b258eafadd7629810928c6af89134 100644 (file)
@@ -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) {
index 352b6a6c53017cbb6ae66c0c682103d95a9819eb..a8fe1fb4ee57fd2ff08ad9ea74089593a76dd1b0 100644 (file)
@@ -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);