[OpenWrt-Devel] [PATCH] dnsmasq: add dhcp relay option

Alexandru Ardelean ardeleanalex at gmail.com
Mon Feb 8 02:19:46 EST 2016


On Tue, Jan 19, 2016 at 11:38 AM, Dan Bugnar <danutbug at gmail.com> wrote:

> Should I remove this part? Maybe comment it (to have a sample) or replace
> with something else.
>
> Dan Bugnar
>
> On Tue, Jan 19, 2016 at 11:20 AM, Dan Bugnar <danutbug at gmail.com> wrote:
>
>> Should I remove this part? Maybe comment it (to have a sample) or replace
>> with something else.
>>
>> Dan Bugnar
>>
>> On Tue, Jan 19, 2016 at 11:11 AM, John Crispin <john at phrozen.org> wrote:
>>
>>>
>>>
>>> On 08/01/2016 16:24, dbugnar wrote:
>>> > Signed-off-by: dbugnar <dnbugnar at ocedo.com>
>>> > ---
>>> >  package/network/services/dnsmasq/files/dhcp.conf    |  6 ++++++
>>> >  package/network/services/dnsmasq/files/dnsmasq.init | 19
>>> +++++++++++++++++++
>>> >  2 files changed, 25 insertions(+)
>>> >
>>> > diff --git a/package/network/services/dnsmasq/files/dhcp.conf
>>> b/package/network/services/dnsmasq/files/dhcp.conf
>>> > index 362b90a..7a66b44 100644
>>> > --- a/package/network/services/dnsmasq/files/dhcp.conf
>>> > +++ b/package/network/services/dnsmasq/files/dhcp.conf
>>> > @@ -30,3 +30,9 @@ config dhcp lan
>>> >  config dhcp wan
>>> >       option interface        wan
>>> >       option ignore   1
>>> > +
>>> > +config relay
>>> > +     option local_addr       '192.168.1.1'
>>> > +     option server_addr      '0.0.0.0'
>>> > +     option interface        'eth0'
>>>
>>>
>>> NAK on this part. you cannot add a static config for eth0/192.168.1.1 as
>>> that is specific to your board and not generic.
>>>
>>>         JOhn
>>>
>>> > +
>>> > diff --git a/package/network/services/dnsmasq/files/dnsmasq.init
>>> b/package/network/services/dnsmasq/files/dnsmasq.init
>>> > index 3ef2b3d..ac45d1b 100644
>>> > --- a/package/network/services/dnsmasq/files/dnsmasq.init
>>> > +++ b/package/network/services/dnsmasq/files/dnsmasq.init
>>> > @@ -538,6 +538,24 @@ dhcp_hostrecord_add() {
>>> >       xappend "--host-record=$record"
>>> >  }
>>> >
>>> > +dhcp_relay_add() {
>>> > +     local cfg="$1"
>>> > +     local local_addr server_addr interface
>>> > +
>>> > +     config_get local_addr "$cfg" local_addr
>>> > +     [ -n "$local_addr" ] || return 0
>>> > +
>>> > +     config_get server_addr "$cfg" server_addr
>>> > +     [ -n "$server_addr" ] || return 0
>>> > +
>>> > +     config_get interface "$cfg" interface
>>> > +     if [ -z "$interface" ]; then
>>> > +             xappend "--dhcp-relay=$local_addr,$server_addr"
>>> > +     else
>>> > +             xappend
>>> "--dhcp-relay=$local_addr,$server_addr,$interface"
>>> > +     fi
>>> > +}
>>> > +
>>> >  service_triggers()
>>> >  {
>>> >       procd_add_reload_trigger "dhcp"
>>> > @@ -597,6 +615,7 @@ start_service() {
>>> >       config_foreach dhcp_subscrid_add subscrid
>>> >       config_foreach dhcp_domain_add domain
>>> >       config_foreach dhcp_hostrecord_add hostrecord
>>> > +     config_foreach dhcp_relay_add relay
>>> >
>>> >       # add own hostname
>>> >       local lanaddr
>>> >
>>>
>>
>>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>
Is there a follow-up to this discussion ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20160208/3c92c082/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list