Re: [OpenWrt-Devel] [PATCH] [packages] openvpn: make comp_lzo a parameter
Hi Philipp, On Mon, Oct 14, 2013 at 02:38:02PM +0200, Philipp Borgers wrote: Possible parameters are yes, no and adaptive. See manpage for more information. Signed-off-by: Philipp Borgers borg...@mi.fu-berlin.de --- package/network/services/openvpn/files/openvpn.config | 4 ++-- package/network/services/openvpn/files/openvpn.init | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Applied with package bump in r38412. Thanks! Luka ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] dropbear: add dropbear.nl mirror, provided by dropbear maintainer
Applied in r38413, thanks! ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH][packages] libnfc: Update to version 1.7.0
Applied in r38414 - thanks! ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 1/6] libgphoto2 depends on libusb-compat, not libusb-1.0
Applied in r38415, thanks! ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 2/6] ddns-scripts: add init script
Applied in r38416 - thanks! ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/6] pptpd: Add uci configuration for PPTPD.
Hi, comments inline. On 11.10.2013 12:30, Bruno Randolf wrote: Signed-off-by: Bruno Randolf b...@einfach.org --- net/pptpd/Makefile| 3 +++ net/pptpd/files/pptpd.init| 40 ++-- net/pptpd/files/pptpd.uciconf | 8 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 net/pptpd/files/pptpd.uciconf diff --git a/net/pptpd/Makefile b/net/pptpd/Makefile index e79e0a7..0a2f642 100644 --- a/net/pptpd/Makefile +++ b/net/pptpd/Makefile @@ -41,6 +41,7 @@ MAKE_FLAGS += \ define Package/pptpd/conffiles /etc/pptpd.conf /etc/ppp/options.pptpd +/etc/config/pptpd endef define Package/pptpd/install @@ -58,6 +59,8 @@ define Package/pptpd/install $(INSTALL_BIN) ./files/pptpd.init $(1)/etc/init.d/pptpd $(INSTALL_DIR) $(1)/etc/ppp $(INSTALL_DATA) ./files/options.pptpd $(1)/etc/ppp/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/pptpd.uciconf $(1)/etc/config/pptpd Per convention, shipped uci configs are called program.config in files/. endef $(eval $(call BuildPackage,pptpd)) diff --git a/net/pptpd/files/pptpd.init b/net/pptpd/files/pptpd.init index a74973c..79c0ab6 100644 --- a/net/pptpd/files/pptpd.init +++ b/net/pptpd/files/pptpd.init @@ -6,14 +6,50 @@ BIN=pptpd DEFAULT=/etc/default/$BIN RUN_D=/var/run PID_F=$RUN_D/$BIN.pid +CONFIG=/tmp/pptpd.conf For consistency, native configs autogenerated from uci should go into the /var/etc directory. +CHAP_SECRETS=/etc/ppp/chap-secrets This should reside in /var/etc or /var/run, if pptp cannot be isntructed to look for this file there it should be symlinked there. -start() { +setup_user() { + local section=$1 + + config_get user $section user + config_get passwd $section passwd + [ -n $user ] || return 0 + [ -n $passwd ] || return 0 + + echo $user pptp-server $passwd * $CHAP_SECRETS This file will grow indefinitely with each system start. +} + +setup_config() { + local section=$1 + + config_get enabled $section enabled + [ $enabled -eq 0 ] return 1 + + cp /etc/pptpd.conf $CONFIG + + config_get localip $section localip + config_get remoteip $section remoteip + [ -n $localip ] echo localip $localip $CONFIG + [ -n $remoteip ] echo remoteip $remoteip $CONFIG + return 0 +} + +start_pptpd() { [ -f $DEFAULT ] . $DEFAULT mkdir -p $RUN_D for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do insmod $m /dev/null 21 done - $BIN $OPTIONS + $BIN $OPTIONS -c $CONFIG This should use service wrappers. +} + +start() { + config_load pptpd + setup_config pptpd || return + [ -e $CHAP_SECRETS ] rm -f $CHAP_SECRETS + config_foreach setup_user key + start_pptpd } stop() { diff --git a/net/pptpd/files/pptpd.uciconf b/net/pptpd/files/pptpd.uciconf new file mode 100644 index 000..66cf0be --- /dev/null +++ b/net/pptpd/files/pptpd.uciconf @@ -0,0 +1,8 @@ +config service 'pptpd' + option 'enabled' '0' + option 'localip' '192.168.0.1' + option 'remoteip' '192.168.0.20-30' + +config 'key' Wouldn't be a section name like config login better suited? + option 'user' 'youruser' + option 'passwd' 'yourpass' For consistency with existing configs it is better to write out the option names, means username and password instead of user and passwd. ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 4/6] pptpd: remove IP in options.pptp
Applied in r38417 - thanks! ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 6/6] isc-dhcp: dhcrelay: Add RFC3527 link selection sub-option
Hi, comments inline. RFC3527 link selection sub-option is used to select the uplink interface of dhcrelay in cases where the DHCP server does not know how to reach the dhcrelay based on the DHCP range. This can happen in weird network configurations like Mesh networks. Signed-off-by: Bruno Randolf b...@einfach.org --- net/isc-dhcp/files/dhcrelay4.init | 8 ++ net/isc-dhcp/files/etc/config/dhcrelay | 3 + .../patches/100-relay-rfc3527-link-selection.patch | 100 + 3 files changed, 111 insertions(+) create mode 100644 net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch diff --git a/net/isc-dhcp/files/dhcrelay4.init b/net/isc-dhcp/files/dhcrelay4.init index 0f87b37..d03722f 100644 --- a/net/isc-dhcp/files/dhcrelay4.init +++ b/net/isc-dhcp/files/dhcrelay4.init @@ -29,6 +29,14 @@ start() { done fi + # link selection sub-option (RFC3527) + local link_selection + config_get link_selection ipv4 link_selection + if [ -n $link_selection ]; then + config_get ifname $link_selection ifname This relies on state vars which will get deprecated soon. Should be converted to use network_get_device from /lib/functions/network.sh. Example: if network_get_device ifname $link_selection; then append args -l $ifname fi + append args -l $ifname + fi + # relay mode local relay_mode config_get relay_mode ipv4 relay_mode diff --git a/net/isc-dhcp/files/etc/config/dhcrelay b/net/isc-dhcp/files/etc/config/dhcrelay index 1b89782..b3b53b5 100644 --- a/net/isc-dhcp/files/etc/config/dhcrelay +++ b/net/isc-dhcp/files/etc/config/dhcrelay @@ -15,6 +15,9 @@ config dhcrelay ipv4 # 'discard': Don't forward option 'relay_mode' '' + # enable RFC3527 link selection sub-option and use the IP address of + # the specified network interface as uplink IP address (e.g. wan) + option 'link_selection' '' config dhcrelay ipv6 #option dhcpserver '2001:db8:1::1' diff --git a/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch b/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch new file mode 100644 index 000..1f593ee --- /dev/null +++ b/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch Can you elaborate on the origin of this patch? Was it written by you? @@ -0,0 +1,100 @@ +--- a/relay/dhcrelay.c b/relay/dhcrelay.c +@@ -65,6 +65,7 @@ int server_packets_relayed = 0;/* Packe + int client_packet_errors = 0; /* Errors sending packets to clients. */ + + int add_agent_options = 0; /* If nonzero, add relay agent options. */ ++int add_rfc3527_suboption = 0; /* If nonzero, add RFC3527 link selection sub-option. */ + + int agent_option_errors = 0;/* Number of packets forwarded without +agent options because there was no room. */ +@@ -104,6 +105,8 @@ struct server_list { + struct sockaddr_in to; + } *servers; + ++struct interface_info *uplink; ++ + #ifdef DHCPv6 + struct stream_list { + struct stream_list *next; +@@ -144,6 +147,7 @@ static const char url[] = + [-pf pid-file] [--no-pid]\n\ + [-m append|replace|forward|discard]\n \ + [-i interface0 [ ... -i interfaceN]\n \ ++ [-l interface]\n \ + server0 [ ... serverN]\n\n \ +dhcrelay -6 [-d] [-q] [-I] [-c hops] [-p port]\n \ + [-pf pid-file] [--no-pid]\n\ +@@ -157,6 +161,7 @@ static const char url[] = + [-pf pid-file] [--no-pid]\n\ + [-m append|replace|forward|discard]\n \ + [-i interface0 [ ... -i interfaceN]\n \ ++[-l interface]\n \ + server0 [ ... serverN]\n\n + #endif + +@@ -314,6 +319,20 @@ main(int argc, char **argv) { + agent_relay_mode = discard; + } else + usage(); ++} else if (!strcmp (argv [i], -l)) { ++add_agent_options = 1; ++add_rfc3527_suboption = 1; ++if (++i == argc) ++usage(); ++ ++status = interface_allocate(uplink, MDL); ++if (status != ISC_R_SUCCESS) ++log_fatal(%s: interface_allocate: %s, ++ argv[i], ++ isc_result_totext(status)); ++strcpy(uplink-name, argv[i]); ++interface_snorf(uplink, INTERFACE_REQUESTED); ++//interface_dereference(uplink, MDL); + } else if (!strcmp(argv[i], -D)) { + #ifdef DHCPv6 + if (local_family_set (local_family == AF_INET6)) { +@@ -685,12 +704,17 @@
Re: [OpenWrt-Devel] [PATCH 5/6] isc-dhcp: dhcrelay: Add more UCI options
Hi, comments inline. Add more options to dhcrelay UCI and init script: - enabled - interfaces: Listen interfaces - relay_mode: What to do about packets that already have a relay option Also mark /etc/config/dhcrelay as conffile Signed-off-by: Bruno Randolf b...@einfach.org --- net/isc-dhcp/Makefile | 8 +++ net/isc-dhcp/files/dhcrelay4.init | 39 -- net/isc-dhcp/files/etc/config/dhcrelay | 24 - 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile index aa27aca..5e5471f 100644 --- a/net/isc-dhcp/Makefile +++ b/net/isc-dhcp/Makefile @@ -55,11 +55,19 @@ $(call Package/isc-dhcp-relay-ipv6/description) This package is compiled with IPv4 support only. endef +define Package/isc-dhcp-relay-ipv4/conffiles +/etc/config/dhcrelay +endef + define Package/isc-dhcp-relay-ipv6/description $(call Package/isc-dhcp-relay/description) This package is compiled with IPv4 and IPv6 support. endef +define Package/isc-dhcp-relay-ipv6/conffiles +/etc/config/dhcrelay +endef + define Package/isc-dhcp-client-ipv4 $(call Package/isc-dhcp/Default) TITLE+= client (without IPv6) diff --git a/net/isc-dhcp/files/dhcrelay4.init b/net/isc-dhcp/files/dhcrelay4.init index 70905cf..0f87b37 100644 --- a/net/isc-dhcp/files/dhcrelay4.init +++ b/net/isc-dhcp/files/dhcrelay4.init @@ -8,15 +8,42 @@ SERVICE_PID_FILE=/var/run/dhcrelay4.pid SERVICE_USE_PID=1 start() { -local relay_dhcpserver + include /lib/network + scan_interfaces This is deprecated, use /lib/functions/network.sh instead. + config_load dhcrelay -config_load dhcrelay -config_get relay_dhcpserver ipv4 dhcpserver + local args= -service_start /usr/sbin/dhcrelay -4 -q \ --pf $SERVICE_PID_FILE $relay_dhcpserver + local enabled + config_get_bool enabled ipv4 enabled 0 + [ $enabled -eq 0 ] return 0 + + # listen interfaces + local interfaces + config_get interfaces ipv4 interfaces + if [ -n $interfaces ]; then + for net in $interfaces; do + local ifname + config_get ifname $net ifname + [ -n $ifname ] append args -i $ifname As noted in Patch 6/6 it should be converted to network_get_device. + done + fi + + # relay mode + local relay_mode + config_get relay_mode ipv4 relay_mode + [ -n $relay_mode ] append args -m $relay_mode + + # dhcp server address + local server + config_get server ipv4 dhcpserver + [ -n $server ] || return 0 + append args $server + + service_start /usr/sbin/dhcrelay -4 -q \ + -pf $SERVICE_PID_FILE $args } stop() { -service_stop /usr/sbin/dhcrelay + service_stop /usr/sbin/dhcrelay } diff --git a/net/isc-dhcp/files/etc/config/dhcrelay b/net/isc-dhcp/files/etc/config/dhcrelay index 5fde239..1b89782 100644 --- a/net/isc-dhcp/files/etc/config/dhcrelay +++ b/net/isc-dhcp/files/etc/config/dhcrelay @@ -1,10 +1,24 @@ config dhcrelay ipv4 -option dhcpserver '192.0.2.10' + option 'enabled' '0' + + # IP address of the server + option 'dhcpserver' '192.0.2.10' + + # network interfaces to listen on (e.g. lan or wan) + option 'interfaces' '' + + # What to do about packets that already have a relay option: + # 'append': Forward and append our own relay option + # 'replace': Forward, but replace theirs with ours (default) + # 'forward': Forward without changes + # 'discard': Don't forward + option 'relay_mode' '' + config dhcrelay ipv6 -#option dhcpserver '2001:db8:1::1' -option upper 'eth1' -list lower 'eth0.2' -list lower 'eth0.3' +#option dhcpserver '2001:db8:1::1' + option upper 'eth1' + list lower 'eth0.2' + list lower 'eth0.3' ~ Jow signature.asc Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] build: remove breaking commas from ubi calls
The extra commas get output by the shell resulting in errors since the commands that get called with those extra commas are then malformed. Signed-off-by: Joris de Vries jo...@apptrician.nl --- include/image.mk |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/image.mk b/include/image.mk index c79d823..8f895a3 100644 --- a/include/image.mk +++ b/include/image.mk @@ -125,7 +125,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),) $(STAGING_DIR_HOST)/bin/mkfs.ubifs \ $(if $($(PROFILE)_UBIFS_OPTS), \ $(shell echo $($(PROFILE)_UBIFS_OPTS)), \ - $(shell echo $(UBIFS_OPTS)), \ + $(shell echo $(UBIFS_OPTS)) \ ) \ $(if $(CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP),--space-fixup) \ $(if $(CONFIG_TARGET_UBIFS_COMPRESSION_NONE),--force-compr=none) \ @@ -143,7 +143,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),) $(STAGING_DIR_HOST)/bin/ubinize \ $(if $($(PROFILE)_UBI_OPTS), \ $(shell echo $($(PROFILE)_UBI_OPTS)), \ - $(shell echo $(UBI_OPTS)), \ + $(shell echo $(UBI_OPTS)) \ ) \ -o $(KDIR)/root.ubi \ ubinize.cfg \ -- 1.7.10.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] build: remove breaking commas from ubi calls
Hi Joris, On Tue, Oct 15, 2013 at 08:41:53PM +0200, Joris de Vries wrote: The extra commas get output by the shell resulting in errors since the commands that get called with those extra commas are then malformed. Signed-off-by: Joris de Vries jo...@apptrician.nl --- include/image.mk |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Applied in r38419. Thank you! Luka ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel