dnsmasq: add option broadcast to host sections
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 11 Oct 2013 18:33:15 +0000 (18:33 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 11 Oct 2013 18:33:15 +0000 (18:33 +0000)
There are certain consumer devices which are outliers in protocol conformance.
An example is Samsung bluray players, which require broadcast DHCP responses
(on Ethernet only, strangely not on Wifi).

By specifying:

config host
...
option broadcast 1

this will enable the response to be sent as an Ethernet broadcast and not as
a unicast.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
SVN-Revision: 38365

package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasq.init

index 6938ba154a5876b0d325163c158c62793c25da26..ae3662b3f592915802cf322a7974e9a8d1541819 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.66
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
index 560928b7640fb4da1c82dc2e4d2b1f3d25abbbde..561f89d33d6a779373392c41f040fe2f44a4ac9c 100644 (file)
@@ -163,6 +163,8 @@ dnsmasq() {
 
        dhcp_option_add "$cfg" "" 0
 
+       xappend "--dhcp-broadcast=tag:needs-broadcast"
+
        echo >> $CONFIGFILE
 }
 
@@ -270,7 +272,10 @@ dhcp_host_add() {
 
        config_get tag "$cfg" tag
 
-       xappend "--dhcp-host=$macs${networkid:+,net:$networkid}${tag:+,set:$tag}${ip:+,$ip}${name:+,$name}"
+       config_get_bool broadcast "$cfg" broadcast 0
+       [ "$broadcast" = "0" ] && broadcast=
+
+       xappend "--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip}${name:+,$name}"
 }
 
 dhcp_tag_add() {