From a3c2b72b6a9e8d8454ea95d69982e6b12349d783 Mon Sep 17 00:00:00 2001 From: Augusto Bott Date: Sun, 17 Jul 2011 02:35:07 -0300 Subject: [PATCH] Bugfix: having DHCP enabled in more than one interface could prevent dnsmasq from starting in some situations --- release/src/router/rc/services.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/release/src/router/rc/services.c b/release/src/router/rc/services.c index 9c85bde429..23941afd1b 100644 --- a/release/src/router/rc/services.c +++ b/release/src/router/rc/services.c @@ -264,16 +264,16 @@ void start_dnsmasq() if ((*p) && (strcmp(p, "0.0.0.0") != 0)) nv = p; } - n = nvram_get_int("dhcpd_lmax"); +// n = nvram_get_int("dhcpd_lmax"); fprintf(f, - "dhcp-option=3,%s\n" // gateway - "dhcp-lease-max=%d\n", - nv, - (n > 0) ? n : 255); + "dhcp-option=3,%s\n", // gateway +// "dhcp-lease-max=%d\n", + nv); +// (n > 0) ? n : 255); - if (nvram_get_int("dhcpd_auth") >= 0) { - fprintf(f, "dhcp-authoritative\n"); - } +// if (nvram_get_int("dhcpd_auth") >= 0) { +// fprintf(f, "dhcp-authoritative\n"); +// } if (((nv = nvram_get("wan_wins")) != NULL) && (*nv) && (strcmp(nv, "0.0.0.0") != 0)) { fprintf(f, "dhcp-option=44,%s\n", nv); @@ -358,6 +358,14 @@ void start_dnsmasq() if (hf) fclose(hf); + n = nvram_get_int("dhcpd_lmax"); + fprintf(f, + "dhcp-lease-max=%d\n", + (n > 0) ? n : 255); + if (nvram_get_int("dhcpd_auth") >= 0) { + fprintf(f, "dhcp-authoritative\n"); + } + // #ifdef TCONFIG_OPENVPN -- 2.11.4.GIT