[OpenWrt-Devel] [PATCH fstools] libfstools: fix find_mount to return device path

2014-12-23 Thread Rafał Miłecki
So far we were returning mount point which doesn't make sense for a
function that already takes mount point as an argument.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 libfstools/find.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libfstools/find.c b/libfstools/find.c
index b50b633..4c69d73 100644
--- a/libfstools/find.c
+++ b/libfstools/find.c
@@ -36,6 +36,9 @@ find_overlay_mount(char *overlay)
return ret;
 }
 
+/*
+ * Find path of a device mounted to the given point.
+ */
 char*
 find_mount(char *mp)
 {
@@ -53,6 +56,7 @@ find_mount(char *mp)
fclose(fp);
return NULL;
}
+   *t = '\0';
t++;
s = strstr(t,  );
if (!s) {
@@ -63,7 +67,7 @@ find_mount(char *mp)
 
if (!strcmp(t, mp)) {
fclose(fp);
-   return t;
+   return line;
}
}
 
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] package: add timer led function

2014-12-23 Thread drEagle
Hi Luka,

Is there patches correct ?
I do not find them in the patchworks.

Regards,
Gérald

Le 20/12/2014 03:51, Gerald Kerma a écrit :
 Add ucidef_set_led_timer to uci-defaults.sh
 
 Signed-off-by: Gerald Kerma drea...@doukki.net
 ---
  .../base-files/files/lib/functions/uci-defaults.sh   | 20 
 
  1 file changed, 20 insertions(+)
 
 diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
 b/package/base-files/files/lib/functions/uci-defaults.sh
 index 6ed0bf1..eb5b240 100644
 --- a/package/base-files/files/lib/functions/uci-defaults.sh
 +++ b/package/base-files/files/lib/functions/uci-defaults.sh
 @@ -120,6 +120,26 @@ EOF
   UCIDEF_LEDS_CHANGED=1
  }
  
 +ucidef_set_led_timer() {
 + local cfg=led_$1
 + local name=$2
 + local sysfs=$3
 + local delayon=$4
 + local delayoff=$5
 +
 + uci -q get system.$cfg  return 0
 +
 + uci batch EOF
 +set system.$cfg='led'
 +set system.$cfg.name='$name'
 +set system.$cfg.sysfs='$sysfs'
 +set system.$cfg.trigger='timer'
 +set system.$cfg.delayon='$delayon'
 +set system.$cfg.delayoff='$delayoff'
 +EOF
 + UCIDEF_LEDS_CHANGED=1
 +}
 +
  ucidef_set_rssimon() {
   local dev=$1
   local refresh=$2
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] scripts: fix recursive dependencies that might be caused by using conditional dependencies.

2014-12-23 Thread Yousong Zhou
On 22 December 2014 at 18:29, Yousong Zhou yszhou4t...@gmail.com wrote:
 `kmod-ipt-ipset' has a `DEPENDS' value of 
 `@(!(TARGET_ps3||TARGET_pxcab)||BROKEN)'.
 Recursive dependency will occur if another package conditionally depends
 on it with something like `+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset'
 which will produce the following kconfig content.

 config PACKAGE_dnsmasq-full
 ...
 depends on !(PACKAGE_dnsmasq_full_ipset) || 
 (!(TARGET_ps3||TARGET_pxcab)||BROKEN)

 if PACKAGE_dnsmasq-full
 ...
 config PACKAGE_dnsmasq_full_ipset
 bool Build with ipset support.
 default y
 ...
 endif

 And mconf will complain with

 tmp/.config-package.in:127:error: recursive dependency detected!
 tmp/.config-package.in:127: symbol PACKAGE_dnsmasq-full depends 
 on PACKAGE_dnsmasq_full_ipset
 tmp/.config-package.in:157: symbol PACKAGE_dnsmasq_full_ipset 
 depends on PACKAGE_dnsmasq-full


Hmm, I think the generated Kconfig and complaints emitted by mconf are fine.

I tried to move the selection of libnettle to
Package/dnsmasq-full/config, but that made the build system Error'ed
with the following.

Package dnsmasq-full is missing dependencies for the following libraries:
libgmp.so.10
libhogweed.so.2
libnettle.so.4
make[2]: ***
[/home/yousong/trunk-openwrt/bin/ar71xx/packages/base/dnsmasq-full_2.72-2_ar71xx.ipk]
Error 1

The build system may need some change to accommodate such conditions.
But we can work around the problem for now by removing ipset's
dependency on TARGET_{ps3,pxcab} as they were obsolete for quite a
while.

Regards

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


[OpenWrt-Devel] [PATCH 1/2] package: remove references to symbols TARGET_{ps3, pxcab}.

2014-12-23 Thread Yousong Zhou
Target pxcab and ps3 were removed from maintaince in r34764 and r34765
respectively.

Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
---
 package/kernel/mac80211/Makefile |2 +-
 package/network/utils/ipset/Makefile |6 --
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 5fa5b8f..df245d0 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -60,7 +60,7 @@ define KernelPackage/mac80211/Default
   SUBMENU:=$(WMENU)
   URL:=http://linuxwireless.org/
   MAINTAINER:=Felix Fietkau n...@openwrt.org
-  DEPENDS:=@(!(TARGET_avr32||TARGET_ps3||TARGET_pxcab)||BROKEN)
+  DEPENDS:=@(!TARGET_avr32||BROKEN)
 endef
 
 define KernelPackage/cfg80211
diff --git a/package/network/utils/ipset/Makefile 
b/package/network/utils/ipset/Makefile
index 16ac8c6..4afcae5 100644
--- a/package/network/utils/ipset/Makefile
+++ b/package/network/utils/ipset/Makefile
@@ -24,12 +24,7 @@ PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/ipset/Default
-  DEPENDS:= @(!(TARGET_ps3||TARGET_pxcab)||BROKEN)
-endef
-
 define Package/ipset
-$(call Package/ipset/Default)
   SECTION:=net
   CATEGORY:=Network
   DEPENDS+= +kmod-ipt-ipset +libmnl
@@ -72,7 +67,6 @@ define Package/ipset/install
 endef
 
 define KernelPackage/ipt-ipset
-$(call Package/ipset/Default)
   SUBMENU:=Netfilter Extensions
   TITLE:=IPset netfilter modules
   DEPENDS+= +kmod-ipt-core +kmod-nfnetlink
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] dnsmasq: fix dependency problems of the dnsmasq-full variant.

2014-12-23 Thread Yousong Zhou
This patch tries to

 - Let the DHCPv6 feature depend on CONFIG_IPV6.
 - Conditionally select libnettle, kmod-ipv6, kmod-ipt-ipset only if the
   corresponding features are enabled.
 - Install `trust-anchors.conf` only if DNSSEC is selected.

Big thanks goes to Frank Schäfer fschaefer@googlemail.com for
providing necessary information on connections and dependency relations
between these CONFIGs and packages.

Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
---
 package/network/services/dnsmasq/Makefile |   37 -
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile 
b/package/network/services/dnsmasq/Makefile
index 1153428..02d4535 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -47,7 +47,7 @@ endef
 define Package/dnsmasq-full
 $(call Package/dnsmasq/Default)
   TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPSET)
-  DEPENDS:=@IPV6 +kmod-ipv6 +libnettle
+  DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle 
+PACKAGE_dnsmasq_full_dhcpv6:kmod-ipv6 
+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset
   VARIANT:=full
 endef
 
@@ -64,7 +64,8 @@ endef
 define Package/dnsmasq-full/description
 $(call Package/dnsmasq/description)
 
-This is a variant with DHCPv6, DNSSEC, Authroitative DNS and IPSET support
+This is a fully configurable variant with DHCPv6, DNSSEC, Authroitative DNS and
+IPSET support enabled by default.
 endef
 
 define Package/dnsmasq/conffiles
@@ -73,21 +74,21 @@ define Package/dnsmasq/conffiles
 endef
 
 define Package/dnsmasq/config/Default
-  if PACKAGE_$(1)-$(2)
-  config PACKAGE_dnsmasq_$(2)_dhcpv6
-bool Build with DHCPv6 support.
-default y
-  config PACKAGE_dnsmasq_$(2)_dnssec
-bool Build with DNSSEC support.
-default y
-  config PACKAGE_dnsmasq_$(2)_auth
-bool Build with the facility to act as an authoritative DNS server.
-default y
-  config PACKAGE_dnsmasq_$(2)_ipset
-bool Build with ipset support.
-select PACKAGE_kmod-ipt-ipset
-default y
-  endif
+   if PACKAGE_$(1)-$(2)
+   config PACKAGE_dnsmasq_$(2)_dhcpv6
+   bool Build with DHCPv6 support.
+   depends on IPV6
+   default y
+   config PACKAGE_dnsmasq_$(2)_dnssec
+   bool Build with DNSSEC support.
+   default y
+   config PACKAGE_dnsmasq_$(2)_auth
+   bool Build with the facility to act as an authoritative DNS 
server.
+   default y
+   config PACKAGE_dnsmasq_$(2)_ipset
+   bool Build with ipset support.
+   default y
+   endif
 endef
 
 Package/dnsmasq-full/config=$(call Package/dnsmasq/config/Default,dnsmasq,full)
@@ -137,8 +138,10 @@ Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
 
 define Package/dnsmasq-full/install
 $(call Package/dnsmasq/install,$(1))
+ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec),)
$(INSTALL_DIR) $(1)/usr/share/dnsmasq
$(INSTALL_DATA) $(PKG_BUILD_DIR)/trust-anchors.conf 
$(1)/usr/share/dnsmasq
+endif
 endef
 
 $(eval $(call BuildPackage,dnsmasq))
-- 
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] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-23 Thread Tomer Eliyahu
Hi,

Our request for uploading the sources is pending approval from
Marvell's legal department.

Best Regards,

Tomer

On Mon, Dec 22, 2014 at 7:01 PM, Hauke Mehrtens ha...@hauke-m.de wrote:
 On 12/22/2014 05:43 PM, Ram Marzin wrote:
 Did I read it right - it relies on hw (to offload the cpu) but is hw 
 independent?
 Does it mean you support Octeon or Realtek fastpath hw too?

 No, it does not rely on hardware, it is a pure SW solution.

 - Ram

 Would it be possible to add some hardware support to it? Many network
 SoCs do have some hardware network engine which supports NAT and some
 similar easy stuff in hardware. This would be a second step after the
 normal fastpath stuff would be integrated in OpenWrt and working. It
 would be very helpful to have some generic layer to control some
 hardware network support engine.

 Hauke

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


Re: [OpenWrt-Devel] [PATCH 1/1] package: contrib: add smstools3 package

2014-12-23 Thread drEagle
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello Jiri,

Le 21/12/2014 08:48, Jiri Slachta a écrit :
 Hello Gerald,
 
 I would recommend you to resend the patch to the openwrt packages repository 
 on
 github as a pull request.

I have proposed and ask for a pull.

Thanks for the review.

Regards,
Gérald

 Please follow the Contributing Guidelines[1] for packages in OpenWrt package 
 repository. In your Makefile the PKG_MAINTAINER is not defined and the 
 PKG_RELEASE 
 should be reset to 1 since the package Makefile is at its initial version.
 
 Kind regards,
 Jiri Slachta
 
 [1] https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md
 
 Dne 21.12.2014 v 08:09 Gerald Kerma napsal(a):
 Add smstools3 package from http://smstools3.kekekasvi.com/
 
 Signed-off-by: Gerald Kerma drea...@doukki.net
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBAgAGBQJUmaxcAAoJEIoWzNw2mnfMEqgH/3YKNvdUFejjD7W5hd3RBS42
LbO8CDPfnCZul3lqo4M0ENhSFr2XL9jxwGdnEl4eckFU8eJSBTxpsSIQ0pSd0K/X
RHF/Gah+wqpGim7QSOUW7jUFFTSXblor/JikSjgBURgu5lnqu/uqi9+W8qz4KkTR
jIkfCykxsqzzcXKU5P0cgUOOMpWqmv3HWbXdln0RTNMbFrciTz5Ssi1R7KVotidB
UecDNW/t9p0+ELQHC5C6Bld7Xl9fdZeac9e77dQH4iYXzBYOKDHeajXKcpnTbD2V
ttrQExLIL9BsbudIbIdQ0Z0/wO4boA/5FhL1FUhIuanfxnlgc29rwUnNfPHFdrE=
=CB7S
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH fstools] libfstools: ubi: avoid crash in volume finding function

2014-12-23 Thread Rafał Miłecki
In case /sys/devices/virtual/ubi/ubi?/ubi?_?/name doesn't exist volname
will be NULL and calling strlen for NULL isn't a good idea.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 libfstools/ubi.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libfstools/ubi.c b/libfstools/ubi.c
index 866034a..ac9eb1b 100644
--- a/libfstools/ubi.c
+++ b/libfstools/ubi.c
@@ -143,6 +143,10 @@ static int ubi_volume_match(struct volume *v, char *name, 
int ubi_num, int volid
/* todo: skip existing gluebi device for legacy support */
 
volname = read_string_from_file(voldir, name);
+   if (!volname) {
+   fprintf(stderr, Couldn't read %s/name\n, voldir);
+   return -1;
+   }
 
if (strncmp(name, volname, strlen(volname) + 1))
return -1;
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] binutils: enable plugin support

2014-12-23 Thread Matthias Schiffer
--enable-plugin is necessary for gcc-ar, gcc-nm and gcc-ranlib to work, which
must be used with GCC 4.9 for LTO to work.

Without this option, gcc-ar etc. will just fail with

sorry - this program has been built without plugin support

Using the normal ar from binutils with GCC 4.9 and -flto will cause linking
with static convenience libraries to fail.

Signed-off-by: Matthias Schiffer mschif...@universe-factory.net
---
 toolchain/binutils/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 820b5f8..8e661b9 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -41,6 +41,7 @@ BINUTILS_CONFIGURE:= \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \
+   --enable-plugins \
--disable-multilib \
--disable-werror \
--disable-nls \
-- 
2.2.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] 090-backport_netfilter_rtcache.patch and IPsec routing/connection errors/packet loss

2014-12-23 Thread Stijn Tintel
On 23-12-14 20:11, Andre Valentin wrote:
 Hi!

 I just recompiled the module and loaded it on the router. But it seems that 
 this does not fix the error. 5 minutes later I got several alerts (ping 
 checks).
The workaround below seems to work for me. How did you apply this patch
to the OpenWrt code
 Untested workaround.
 I'll look into this in more detail over the holidays.

 netfilter: rtcache: don't cache dst for skb with active transformer

 diff --git a/net/netfilter/nf_conntrack_rtcache.c 
 b/net/netfilter/nf_conntrack_rtcache.c
 --- a/net/netfilter/nf_conntrack_rtcache.c
 +++ b/net/netfilter/nf_conntrack_rtcache.c
 @@ -19,6 +19,7 @@
  #include linux/module.h

  #include net/dst.h
 +#include net/xfrm.h

  #include net/netfilter/nf_conntrack.h
  #include net/netfilter/nf_conntrack_core.h
 @@ -191,6 +192,9 @@ static unsigned int nf_rtcache_forward(const struct 
 nf_hook_ops *ops,
 struct nf_conn *ct;
 int iif;

 +   if (secpath_exists(skb))
 +   return NF_ACCEPT;
 +
 ct = nf_ct_get(skb, ctinfo);
 if (!ct)
 return NF_ACCEPT;
Kind regards,
Stijn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH][mvebu] WRT1900AC mvneta fix vlan tagging

2014-12-23 Thread Mark Milburn
This is a 3.14.x backport of:
mvneta: Fix TSO and checksum for non-acceleration vlan traffic

Fixes vlan tagging on SoC interfaces for the WRT1900AC.  Useful
when using mvsw6171 driver.

Here's hoping I didn't foul up the patch format this time.

Signed-off-by: Mark Milburn mark.a.milb...@gmail.com
---
 .../110-mvneta_fix_tso_and_chksum.patch| 38 ++
 1 file changed, 38 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch

diff --git 
a/target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch 
b/target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch
new file mode 100644
index 000..7115468
--- /dev/null
+++ b/target/linux/mvebu/patches-3.14/110-mvneta_fix_tso_and_chksum.patch
@@ -0,0 +1,38 @@
+--- a/drivers/net/ethernet/marvell/mvneta.c
 b/drivers/net/ethernet/marvell/mvneta.c
+@@ -20,6 +20,7 @@
+ #include linux/mbus.h
+ #include linux/module.h
+ #include linux/interrupt.h
++#include linux/if_vlan.h
+ #include net/ip.h
+ #include net/ipv6.h
+ #include linux/io.h
+@@ -1380,15 +1381,16 @@ static u32 mvneta_skb_tx_csum(struct mvn
+ {
+   if (skb-ip_summed == CHECKSUM_PARTIAL) {
+   int ip_hdr_len = 0;
++  __be16 l3_proto = vlan_get_protocol(skb);
+   u8 l4_proto;
+ 
+-  if (skb-protocol == htons(ETH_P_IP)) {
++  if (l3_proto == htons(ETH_P_IP)) {
+   struct iphdr *ip4h = ip_hdr(skb);
+ 
+   /* Calculate IPv4 checksum and L4 checksum */
+   ip_hdr_len = ip4h-ihl;
+   l4_proto = ip4h-protocol;
+-  } else if (skb-protocol == htons(ETH_P_IPV6)) {
++  } else if (l3_proto == htons(ETH_P_IPV6)) {
+   struct ipv6hdr *ip6h = ipv6_hdr(skb);
+ 
+   /* Read l4_protocol from one of IPv6 extra headers */
+@@ -1399,7 +1401,7 @@ static u32 mvneta_skb_tx_csum(struct mvn
+   return MVNETA_TX_L4_CSUM_NOT;
+ 
+   return mvneta_txq_desc_csum(skb_network_offset(skb),
+-  skb-protocol, ip_hdr_len, l4_proto);
++  l3_proto, ip_hdr_len, l4_proto);
+   }
+ 
+   return MVNETA_TX_L4_CSUM_NOT;
-- 
2.2.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] ustream: add function ustream_read().

2014-12-23 Thread Yousong Zhou
On 22 December 2014 at 22:46, Felix Fietkau n...@openwrt.org wrote:
 On 2014-12-16 22:15, Yousong Zhou wrote:
 It can be used to fill caller specified buffer area with data already in
 ustream read buffer. Useful in the following use pattern.

 int available = ustream_pending_data(s, false);
 if (available = sizeof(struct msghdr)) {
 struct msghdr h;
 ustream_read(s, h, sizeof(h));
 }


snip

 +
 I'd expect ustream_read() to consume the data it has read.
 It should also probably just use ustream_get_read_buf() and
 ustream_consume() instead of open-coding its functionality.

I tend to peek inside the msghdr to get the total length then consume
them as a whole if there is enough available in the read buffer.  But
I am fine with either way.

Regards.

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