2013/5/31 Jonas Gorski <[email protected]>

> On Tue, May 28, 2013 at 4:53 PM, Mathias Kresin <[email protected]> wrote:
> > Updated version of the patch without hardcoded interface. lanaddr isn't
> > used anymore so drop it.
> >
> > Use the --interface-name option of dnsmasq to add a DNS record for the
> > openwrt box. Starting with dnsmasq 2.67test5 it does even work for ipv6
> > addresses. IPv6 addresses with an expired lifetime will be
> > automatically replaced with a new valid one.
> >
> > Signed-off-by: Mathias Kresin <[email protected]>
> > ---
> > Index: package/network/services/dnsmasq/files/dnsmasq.init
> > ===================================================================
> > --- package/network/services/dnsmasq/files/dnsmasq.init (revision 36743)
> > +++ package/network/services/dnsmasq/files/dnsmasq.init (working copy)
> > @@ -473,8 +473,8 @@
> >         include /lib/network
> >         scan_interfaces
> >
> > -       local lanaddr
> > -       config_get lanaddr "lan" ipaddr
> > +       local lanifname
> > +       config_get lanifname "lan" ifname
>
> This will now instead break bridge lan interfaces, as ifname contains
> the bridge member interface(s), which won't have any ips assigned. Try
> network_get_device() from /lib/functions/network.sh. Also I wonder if
> the lan interface name should be really hardcoded, but this would be
> something for a different patch.
>

It doesn't break bridge lan interfaces! Obviously ifname gets replaced with
the real interface name somewhere. I re-checked it against r36760 a few
minutes ago:

root@OpenWrt:~# grep -A6 'lan' /etc/config/network && grep -B1
interface-name /var/etc/dnsmasq.conf
config interface 'lan'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'


interface-name=OpenWrt.lan, eth0

root@OpenWrt:~# grep -A6 'lan' /etc/config/network && grep -B1
interface-name /var/etc/dnsmasq.conf
config interface 'lan'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option type 'bridge'

interface-name=OpenWrt.lan, br-lan

Mathias
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to