Changeset 8695

Show
Ignore:
Timestamp:
06/03/12 19:19:13 (12 months ago)
Author:
jow
Message:

protocols/core: fix peerdns option for dhcp proto

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua

    r8072 r8695  
    22LuCI - Lua Configuration Interface 
    33 
    4 Copyright 2011 Jo-Philipp Wich <xm@subsignal.org> 
     4Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org> 
    55 
    66Licensed under the Apache License, Version 2.0 (the "License"); 
     
    1515 
    1616local hostname, accept_ra, send_rs 
    17 local bcast, no_gw, no_dns, dns, metric, clientid, vendorclass 
     17local bcast, no_gw, peerdns, dns, metric, clientid, vendorclass 
    1818 
    1919 
     
    6363 
    6464 
    65 no_dns = section:taboption("advanced", Flag, "_no_dns", 
     65peerdns = section:taboption("advanced", Flag, "peerdns", 
    6666    translate("Use DNS servers advertised by peer"), 
    6767    translate("If unchecked, the advertised DNS server addresses are ignored")) 
    6868 
    69 no_dns.default = no_dns.enabled 
    70  
    71 function no_dns.cfgvalue(self, section) 
    72     local addr 
    73     for addr in luci.util.imatch(m:get(section, "dns")) do 
    74         return self.disabled 
    75     end 
    76     return self.enabled 
    77 end 
    78  
    79 function no_dns.remove(self, section) 
    80     return m:del(section, "dns") 
    81 end 
    82  
    83 function no_dns.write() end 
     69peerdns.default = peerdns.enabled 
    8470 
    8571 
     
    8773    translate("Use custom DNS servers")) 
    8874 
    89 dns:depends("_no_dns", "") 
     75dns:depends("peerdns", "") 
    9076dns.datatype = "ipaddr" 
    9177dns.cast     = "string"