From 947bab0abbee71ec839eb4cb8fdf88f314d82f2a Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Sat, 17 Mar 2007 13:31:13 +0000
Subject: upgrade dnsmasq to latest version, rewrite dnsmasq init script for
 uci, rename /bin/ipcalc to /bin/ipcalc.sh (fixes #1452)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6595 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 package/base-files/files/bin/ipcalc    | 32 ------------
 package/base-files/files/bin/ipcalc.sh | 32 ++++++++++++
 package/dnsmasq/Makefile               |  7 +--
 package/dnsmasq/files/dhcp.conf        |  9 ++++
 package/dnsmasq/files/dnsmasq.conf     |  6 ---
 package/dnsmasq/files/dnsmasq.init     | 96 +++++++++++++++++++---------------
 6 files changed, 99 insertions(+), 83 deletions(-)
 delete mode 100755 package/base-files/files/bin/ipcalc
 create mode 100755 package/base-files/files/bin/ipcalc.sh
 create mode 100644 package/dnsmasq/files/dhcp.conf

(limited to 'package')

diff --git a/package/base-files/files/bin/ipcalc b/package/base-files/files/bin/ipcalc
deleted file mode 100755
index e8efa6b96c..0000000000
--- a/package/base-files/files/bin/ipcalc
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-awk -f /usr/lib/common.awk -f - $* <<EOF
-BEGIN {
-	ipaddr=ip2int(ARGV[1])
-	netmask=ip2int(ARGV[2])
-	network=and(ipaddr,netmask)
-	broadcast=or(network,compl(netmask))
-	
-	start=or(network,and(ip2int(ARGV[3]),compl(netmask)))
-	limit=network+1
-	if (start<limit) start=limit
-	
-	end=start+ARGV[4]
-	limit=or(network,compl(netmask))-1
-	if (end>limit) end=limit
-
-	print "IP="int2ip(ipaddr)
-	print "NETMASK="int2ip(netmask)
-	print "BROADCAST="int2ip(broadcast)
-	print "NETWORK="int2ip(network)
-	print "PREFIX="32-bitcount(compl(netmask))
-	
-	# range calculations:
-	# ipcalc <ip> <netmask> <start> <num>
-	
-	if (ARGC > 3) {
-		print "START="int2ip(start)
-		print "END="int2ip(end-1)
-	}
-}
-EOF
diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
new file mode 100755
index 0000000000..e8efa6b96c
--- /dev/null
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+awk -f /usr/lib/common.awk -f - $* <<EOF
+BEGIN {
+	ipaddr=ip2int(ARGV[1])
+	netmask=ip2int(ARGV[2])
+	network=and(ipaddr,netmask)
+	broadcast=or(network,compl(netmask))
+	
+	start=or(network,and(ip2int(ARGV[3]),compl(netmask)))
+	limit=network+1
+	if (start<limit) start=limit
+	
+	end=start+ARGV[4]
+	limit=or(network,compl(netmask))-1
+	if (end>limit) end=limit
+
+	print "IP="int2ip(ipaddr)
+	print "NETMASK="int2ip(netmask)
+	print "BROADCAST="int2ip(broadcast)
+	print "NETWORK="int2ip(network)
+	print "PREFIX="32-bitcount(compl(netmask))
+	
+	# range calculations:
+	# ipcalc <ip> <netmask> <start> <num>
+	
+	if (ARGC > 3) {
+		print "START="int2ip(start)
+		print "END="int2ip(end-1)
+	}
+}
+EOF
diff --git a/package/dnsmasq/Makefile b/package/dnsmasq/Makefile
index 2b6e7945cb..6b763741de 100644
--- a/package/dnsmasq/Makefile
+++ b/package/dnsmasq/Makefile
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.35
+PKG_VERSION:=2.38
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
-PKG_MD5SUM:=57b8643dc394cf2fbd1bced64536c6df
+PKG_MD5SUM:=ab066a97c226066485ad20e5ad5ce424
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -42,7 +42,8 @@ endef
 define Package/dnsmasq/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dnsmasq $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc
+	$(INSTALL_DIR) $(1)/etc/config
+	$(INSTALL_DATA) ./files/dhcp.conf $(1)/etc/config/dhcp
 	$(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
 	$(INSTALL_DIR) $(1)/etc/init.d
 	$(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq
diff --git a/package/dnsmasq/files/dhcp.conf b/package/dnsmasq/files/dhcp.conf
new file mode 100644
index 0000000000..fb55cf8b77
--- /dev/null
+++ b/package/dnsmasq/files/dhcp.conf
@@ -0,0 +1,9 @@
+config dhcp
+	option interface	lan
+	option start 	100
+	option limit	150
+	option leasetime	12h
+
+config dhcp
+	option interface	wan
+	option ignore	1
diff --git a/package/dnsmasq/files/dnsmasq.conf b/package/dnsmasq/files/dnsmasq.conf
index 8a8191b635..5be394696a 100644
--- a/package/dnsmasq/files/dnsmasq.conf
+++ b/package/dnsmasq/files/dnsmasq.conf
@@ -10,14 +10,8 @@ domain=lan
 expand-hosts
 resolv-file=/tmp/resolv.conf.auto
 
-@ifdef dhcp_enable
-dhcp-range=@@start@@,@@end@@,@@netmask@@,@@lease@@
 dhcp-authoritative
 dhcp-leasefile=/tmp/dhcp.leases
-@endif
-@ifdef wan_ifname
-except-interface=@@wan_ifname@@
-@endif
 
 # use /etc/ethers for static hosts; same format as --dhcp-host
 # <hwaddr> <ipaddr>
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
index 5e72fd014f..52973d4ca0 100644
--- a/package/dnsmasq/files/dnsmasq.init
+++ b/pa<style>pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="c1">#menu &quot;rrs............................... A reverse (connecting) remote shell&quot;</span>

<span class="k">config</span> BR2_COMPILE_RRS
	<span class="nb">tristate</span>
	<span class="k">default</span> n
	depends BR2_PACKAGE_RRS <span class="o">||</span> BR2_PACKAGE_RRS_NOSSL

<span class="k">config</span> BR2_PACKAGE_RRS
	<span class="k">prompt</span> <span class="s2">&quot;rrs............................... A reverse (connecting) remote shell, with SSL support&quot;</span>
	<span class="nb">tristate</span>
	<span class="k">default</span> m <span class="k">if</span> CONFIG_DEVEL
	<span class="k">select</span> BR2_COMPILE_RRS
	<span class="k">select</span> BR2_PACKAGE_UCLIBCXX
	<span class="k">select</span> BR2_PACKAGE_LIBOPENSSL
	<span class="k">help</span>
<span class="sd">	  A reverse (connecting) remote shell, built with SSL support.</span>
<span class="sd">	  </span>
<span class="sd">	  http://www.cycom.se/dl/rrs/</span>

<span class="k">config</span> BR2_PACKAGE_RRS_NOSSL
	<span class="k">prompt</span> <span class="s2">&quot;rrs-nossl......................... A reverse (connecting) remote shell, without SSL support&quot;</span>
	<span class="nb">tristate</span>
	<span class="k">default</span> m <span class="k">if</span> CONFIG_DEVEL
	<span class="k">select</span> BR2_COMPILE_RRS
	<span class="k">select</span> BR2_PACKAGE_UCLIBCXX
	<span class="k">help</span>
<span class="sd">	  A reverse (connecting) remote shell, built without SSL support.</span>
<span class="sd">	  </span>
<span class="sd">	  http://www.cycom.se/dl/rrs/</span>

<span class="c1">#endmenu</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.25.1</a>) at 2025-01-22 10:12:15 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
