Re: [OpenWrt-Devel] [PATCH] dnsmasq - bump version and add config option for ra_names

2012-07-22 Thread Gui Iribarren
I can confirm this patch works as expected, applied on trunk compiled cleanly
and yields dnsmasq 2.62

root@OpenWrt:~# dnsmasq -v
Dnsmasq version 2.62  Copyright (c) 2000-2012 Simon Kelley
Compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP
DHCPv6 no-Lua TFTP no-conntrack

Thanks a lot Dominique!

On Fri, Jul 6, 2012 at 3:27 AM, Dominique Martinet
asmad...@codewreck.org wrote:


 so no further init script change needed!
Agreed, nevertheless it could probably be handy at some point to
submit another patch adding an option dns6 or something like that,
to simplify config management. I might try to take a stab at it, but
no promises.
For the moment, using option6 sounds perfect.


 Regards,
 --
 Asmadeus | Dominique Martinet
 late for work :D
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] dnsmasq - bump version and add config option for ra_names

2012-07-06 Thread Dominique Martinet
Gui Iribarren wrote on Thu, Jul 05, 2012 :
 I'm currently using the config rdnss feature of radvd so that  SLAAC
 hosts also get a DNS server entry, again independent of dhcpv4. I
 assume that's also possible with this new scheme, right?
 i could search about it on dnsmasq documentation , but you seem to
 have immersed in the subject much more than i could achieve right now.

I'll have to say I haven't used this yet, so none of my clients had a
rnssd running :)
Nevertheless, the documentation is good enough (I'm using
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html )
It states:
--enable-ra
[...] If provided, the DHCPv6 options dns-server and domain-search
are used for RDNSS and DNSSL. 

As well as:
IPv6 options are specified using the option6: keyword, followed by the
option number or option name. The IPv6 option name space is disjoint
from the IPv4 option name space. IPv6 addresses in options must be
bracketed with square brackets,
eg. --dhcp-option=option6:ntp-server,[1234::56] 



As far as experiments go, without any option dnsmasq advertises the
router local address, but my resolvconf doesnt add it to
/etc/resolv.conf
Also, adding a line like this works as expected:
--dhcp-option=option6:dns-server,[2001:dead:beef::1]

I couldn't get it to accept a domain-search, but I'm not quite sure if
rnssd supports it anyway :)


Given the openwrt conf sytax already supports dhcp-options, adding a few
lines in the conf should work:
config 'dhcp'
option 'interface' 'lan'
list 'dhcp_option' 'option6:dns-server,[2001:dead:beef::1]'

which ends up like:
dhcp-option=lan,option6:dns-server,[2001:dead:beef::1]


so no further init script change needed!

Regards,
-- 
Asmadeus | Dominique Martinet
late for work :D
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] dnsmasq - bump version and add config option for ra_names

2012-07-05 Thread Dominique Martinet
Hi,

(I just subscribed to the list, so sorry if my mail format isn't right
somehow. I quickly glanced at the archive and don't think what I offer
has been looked at, aside of a quick reference to the changelog when
the feature wasn't available in a stable release of dnsmasq yet)

ra_names is a feature introduced in dnsmasq 2.61, which is why I changed
the rules to build something newer (and figured I might as well take it
to 62)
Basically, it:
 - does router-advertisment (not dhcpv6)
 - when it gets a request for RA, it looks up if there is an active ipv4
 lease for the same host via its MAC address, and if there is it adds
 the to-be ipv6 to the local dns (assuming the host will take the dns)
 - when it gets a dhcpv4 release it takes off the ipv6 dns record as
 well

(since RA is stateless and doesn't give the host name, I couldn't figure
any better way without dhcpv6; I was about to hack something (with a
very large axe and radvd) when I found out they've done it already :D)

There are also modes for router-advertisment only which I haven't looked
at, and a dhcpv6 client implementation that I didn't try yet either.


The option I added is in the dhcp field, a ra_name option with the
prefix to announce in RAs, i.e.

config dhcp 'lan'
option interface 'lan'
option ra_names '2001:dead:beef::'


(Note: it doesn't seem to add the local dns with a fe80:: prefix)


Attached is the patch in svn format, feel free to ask if you prefer git's (I
personally do but didn't look hard enough for the git repository!)


Please give any comment and include something similar if you like it.

Rergards,
-- 
Dominique Martinet | Asmadeus
Index: package/dnsmasq/files/dnsmasq.init
===
--- package/dnsmasq/files/dnsmasq.init	(revision 32579)
+++ package/dnsmasq/files/dnsmasq.init	(working copy)
@@ -360,6 +360,12 @@
 	xappend --dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}
 
 	dhcp_option_add $cfg $networkid
+
+	config_get ra_names $cfg ra_names
+
+	[ -n $ra_names ]  {
+		xappend --dhcp-range=$networkid,$ra_names,ra-names,$leasetime
+	}
 }
 
 dhcp_option_add() {
Index: package/dnsmasq/patches/101-ipv6.patch
===
--- package/dnsmasq/patches/101-ipv6.patch	(revision 32579)
+++ package/dnsmasq/patches/101-ipv6.patch	(working copy)
@@ -1,13 +0,0 @@
 a/src/config.h
-+++ b/src/config.h
-@@ -263,8 +263,9 @@ NOTES:
- /* We assume that systems which don't have IPv6
-headers don't have ntop and pton either */
- 
--#if defined(INET6_ADDRSTRLEN)  defined(IPV6_V6ONLY)  !defined(NO_IPV6)
-+#if defined(INET6_ADDRSTRLEN)  !defined(NO_IPV6)
- #  define HAVE_IPV6
-+#  define IPV6_V6ONLY 26
- #  define ADDRSTRLEN INET6_ADDRSTRLEN
- #  if defined(SOL_IPV6)
- #define IPV6_LEVEL SOL_IPV6
Index: package/dnsmasq/Makefile
===
--- package/dnsmasq/Makefile	(revision 32579)
+++ package/dnsmasq/Makefile	(working copy)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.59
-PKG_RELEASE:=4
+PKG_VERSION:=2.62
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
-PKG_MD5SUM:=b5757ef2d7b651748eeebb88af29d7d6
+PKG_MD5SUM:=f47e5cb8f5bac6343f24b2dbe317ab40
 
 PKG_INSTALL:=1
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] dnsmasq - bump version and add config option for ra_names

2012-07-05 Thread Gui Iribarren
On Thu, Jul 5, 2012 at 3:38 PM, Dominique Martinet
asmad...@codewreck.org wrote:
 Hi,

 (I just subscribed to the list, so sorry if my mail format isn't right
 somehow. I quickly glanced at the archive and don't think what I offer
 has been looked at, aside of a quick reference to the changelog when
 the feature wasn't available in a stable release of dnsmasq yet)

 ra_names is a feature introduced in dnsmasq 2.61, which is why I changed
 the rules to build something newer (and figured I might as well take it
 to 62)
 Basically, it:
  - does router-advertisment (not dhcpv6)
  - when it gets a request for RA, it looks up if there is an active ipv4
  lease for the same host via its MAC address, and if there is it adds
  the to-be ipv6 to the local dns (assuming the host will take the dns)
  - when it gets a dhcpv4 release it takes off the ipv6 dns record as
  well

 (since RA is stateless and doesn't give the host name, I couldn't figure
 any better way without dhcpv6; I was about to hack something (with a
 very large axe and radvd) when I found out they've done it already :D)

This is gorgeous Dominique,
My planned hack involved ladvd and flooding the network with LLDP
packets, then parse the info inside those packets and spew it in
/tmp/dhcp.leases
I was just waiting for ladvd dev to patch the source so that it can
compile cleanly on OpenWrt.
While that scheme doesn't depend on ipv4, ra_names is definitely more
elegant and as long as double-stack is the standard, i'll buy it!

 There are also modes for router-advertisment only which I haven't looked
 at, and a dhcpv6 client implementation that I didn't try yet either.


 The option I added is in the dhcp field, a ra_name option with the
 prefix to announce in RAs, i.e.

 config dhcp 'lan'
 option interface 'lan'
 option ra_names '2001:dead:beef::'

I understand this serves the double purpose of activating this
feature, and at the same time making dnsmasq send RA, so no radvd is
needed
 or does it depend on RA sent by radvd ?
in the second case, wouldn't it make sense to get the prefix config
directly from /etc/config/radvd instead of duplicating information?



 (Note: it doesn't seem to add the local dns with a fe80:: prefix)

It shouldn't, AFAIU link-local addresses are not meant to be resolved,
since they always need the interface scope suffix




 Attached is the patch in svn format, feel free to ask if you prefer git's (I
 personally do but didn't look hard enough for the git repository!)


 Please give any comment and include something similar if you like it.

 Rergards,
 --
 Dominique Martinet | Asmadeus

 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] dnsmasq - bump version and add config option for ra_names

2012-07-05 Thread Dominique Martinet
Hi,

Gui Iribarren wrote on Thu, Jul 05, 2012 :
 On Thu, Jul 5, 2012 at 3:38 PM, Dominique Martinet
 asmad...@codewreck.org wrote:
  config dhcp 'lan'
  option interface 'lan'
  option ra_names '2001:dead:beef::'
 
 I understand this serves the double purpose of activating this
 feature, and at the same time making dnsmasq send RA, so no radvd is
 needed
  or does it depend on RA sent by radvd ?
 in the second case, wouldn't it make sense to get the prefix config
 directly from /etc/config/radvd instead of duplicating information?

It effectively makes radvd unneeded (but harmless, I just tried with
both running with my previous radvd configuration), so it seems better
to give the prefix here.
I'm pretty sure it would be possible to have the same feature with
announces only from radvd and dnsmasq passively listening, but I didn't
find a way to do so and for what I've been using radvd it doesn't seem
to change much.


Also I forgot to say it in the mail body, but I removed some ipv6 patch
for dnsmasq as it no longer applied, I am not quite sure what or if it
implies anything.

-- 
Asmadeus | Dominique Martinet
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] dnsmasq - bump version and add config option for ra_names

2012-07-05 Thread Gui Iribarren
On Thu, Jul 5, 2012 at 5:18 PM, Dominique Martinet
asmad...@codewreck.org wrote:
 Hi,

 Gui Iribarren wrote on Thu, Jul 05, 2012 :
 On Thu, Jul 5, 2012 at 3:38 PM, Dominique Martinet
 asmad...@codewreck.org wrote:
  config dhcp 'lan'
  option interface 'lan'
  option ra_names '2001:dead:beef::'

 I understand this serves the double purpose of activating this
 feature, and at the same time making dnsmasq send RA, so no radvd is
 needed
  or does it depend on RA sent by radvd ?
 in the second case, wouldn't it make sense to get the prefix config
 directly from /etc/config/radvd instead of duplicating information?

 It effectively makes radvd unneeded (but harmless, I just tried with
 both running with my previous radvd configuration), so it seems better
 to give the prefix here.
Agree, great to know.
 I'm pretty sure it would be possible to have the same feature with
 announces only from radvd and dnsmasq passively listening, but I didn't
 find a way to do so and for what I've been using radvd it doesn't seem
 to change much.

I'm currently using the config rdnss feature of radvd so that  SLAAC
hosts also get a DNS server entry, again independent of dhcpv4. I
assume that's also possible with this new scheme, right?
i could search about it on dnsmasq documentation , but you seem to
have immersed in the subject much more than i could achieve right now.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel