[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 
---
 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 
> ---
>  .../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 < +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  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 
---
 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 
-  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  for
providing necessary information on connections and dependency relations
between these CONFIGs and packages.

Signed-off-by: Yousong Zhou 
---
 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  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 
> 

-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][ar71xx] Mikrotik Routerboard RB2011 switch fix

2014-12-23 Thread Matt Lee
Hi Chris,

>This patch is the same as the Routerboard 951G fix, I've built this
>and tested it on my rb-2011uias-2hnd.  However we should check that it
>also works on other/older RB2011 routers which did work OK with the
>unpatched code.
>
>diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>index b73fae6..951ab94 100644
>--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>@@ -270,6 +270,7 @@ static int __init rb2011_setup(u32 flags)
>rb2011_nand_init();
>
>ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
>+   AR934X_ETH_CFG_RXD_DELAY |
>   AR934X_ETH_CFG_SW_ONLY_MODE);
>
>ath79_register_mdio(1, 0x0);
>@@ -283,7 +284,7 @@ static int __init rb2011_setup(u32 flags)
>ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
>ath79_eth0_data.phy_mask = BIT(0);
>ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
>-   ath79_eth0_pll_data.pll_1000 = 0x0600;
>+   ath79_eth0_pll_data.pll_1000 = 0x3e00;
>
>ath79_register_eth(0);
>
>--
>Chris Green
This patch is not working correctly for me on the 2011UiAS-2HnD.  Many
packets are dropped, and I can see many FCS Errors and RxBadByte.

root@OpenWrt:/# swconfig dev ag71xx-mdio.0 port 0 show
Port 0:
mib: Port 0 MIB counters
RxBroad : 8
RxPause : 0
RxMulti : 15
RxFcsErr: 800
RxAlignErr  : 0
RxRunt  : 0
RxFragment  : 0
Rx64Byte: 7
Rx128Byte   : 17323
Rx256Byte   : 6
Rx512Byte   : 9
Rx1024Byte  : 0
Rx1518Byte  : 0
RxMaxByte   : 0
RxTooLong   : 0
RxGoodByte  : 1145334
RxBadByte   : 65266
RxOverFlow  : 0
Filtered: 11
TxBroad : 244
TxPause : 0
TxMulti : 170
TxUnderRun  : 0
Tx64Byte: 21
Tx128Byte   : 360
Tx256Byte   : 20
Tx512Byte   : 44
Tx1024Byte  : 14459
Tx1518Byte  : 3
TxMaxByte   : 5683
TxOverSize  : 0
TxByte  : 16836688
TxCollision : 0
TxAbortCol  : 0
TxMultiCol  : 0
TxSingleCol : 0
TxExcDefer  : 0
TxDefer : 0
TxLateCol   : 0
pvid: 0
link: port:0 link:up speed:1000baseT full-duplex txflow rxflow

How can we determine the right value for the  ath79_eth0_pll_data.pll_1000 ?

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


Re: [OpenWrt-Devel] [PATCH][ar71xx] Mikrotik Routerboard RB2011 switch fix

2014-12-23 Thread David Hutchison
Hello,

Can you try: ath79_eth0_pll_data.pll_1000 = 0x6f000;

This is the value I originally found on the 951G, I tried to toggle as
many bits as possible and narrow down from there. John Crispin found
some documentation and we narrowed it down to 0x3e00 for the 951G.
He is actually working on a patch that will grab the correct
ath79_eth0_pll_data.pll_1000 value from the bootloader. That way this
becomes dynamic. I do not know the progress he has made on it.

http://comments.gmane.org/gmane.comp.embedded.openwrt.devel/28589

Here is our original thread, where John posted the relevant datasheet.
You can take the same approach we did, and narrow down to find your
correct bits.

It may also be easier to wait for his patch where he will dynamically set it.

Hope this helps,

-- Davey

On Tue, Dec 23, 2014 at 11:23 AM, Matt Lee  wrote:
> Hi Chris,
>
>>This patch is the same as the Routerboard 951G fix, I've built this
>>and tested it on my rb-2011uias-2hnd.  However we should check that it
>>also works on other/older RB2011 routers which did work OK with the
>>unpatched code.
>>
>>diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>>b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>>index b73fae6..951ab94 100644
>>--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>>+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
>>@@ -270,6 +270,7 @@ static int __init rb2011_setup(u32 flags)
>>rb2011_nand_init();
>>
>>ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
>>+   AR934X_ETH_CFG_RXD_DELAY |
>>   AR934X_ETH_CFG_SW_ONLY_MODE);
>>
>>ath79_register_mdio(1, 0x0);
>>@@ -283,7 +284,7 @@ static int __init rb2011_setup(u32 flags)
>>ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
>>ath79_eth0_data.phy_mask = BIT(0);
>>ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
>>-   ath79_eth0_pll_data.pll_1000 = 0x0600;
>>+   ath79_eth0_pll_data.pll_1000 = 0x3e00;
>>
>>ath79_register_eth(0);
>>
>>--
>>Chris Green
> This patch is not working correctly for me on the 2011UiAS-2HnD.  Many
> packets are dropped, and I can see many FCS Errors and RxBadByte.
>
> root@OpenWrt:/# swconfig dev ag71xx-mdio.0 port 0 show
> Port 0:
> mib: Port 0 MIB counters
> RxBroad : 8
> RxPause : 0
> RxMulti : 15
> RxFcsErr: 800
> RxAlignErr  : 0
> RxRunt  : 0
> RxFragment  : 0
> Rx64Byte: 7
> Rx128Byte   : 17323
> Rx256Byte   : 6
> Rx512Byte   : 9
> Rx1024Byte  : 0
> Rx1518Byte  : 0
> RxMaxByte   : 0
> RxTooLong   : 0
> RxGoodByte  : 1145334
> RxBadByte   : 65266
> RxOverFlow  : 0
> Filtered: 11
> TxBroad : 244
> TxPause : 0
> TxMulti : 170
> TxUnderRun  : 0
> Tx64Byte: 21
> Tx128Byte   : 360
> Tx256Byte   : 20
> Tx512Byte   : 44
> Tx1024Byte  : 14459
> Tx1518Byte  : 3
> TxMaxByte   : 5683
> TxOverSize  : 0
> TxByte  : 16836688
> TxCollision : 0
> TxAbortCol  : 0
> TxMultiCol  : 0
> TxSingleCol : 0
> TxExcDefer  : 0
> TxDefer : 0
> TxLateCol   : 0
> pvid: 0
> link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
>
> How can we determine the right value for the  ath79_eth0_pll_data.pll_1000 ?
>
> -matt
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
___
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 Andre Valentin
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).

Kind regards,

André

On 20.12.2014 00:56, Florian Westphal wrote:
> Andre Valentin  wrote:
>> If I enable this patch/module, I get strange errors with my OpenWRT based 
>> IPsec router. Packets are accepted and then lost, and not encrypted. Only 
>> the first comes through, especially if stateless
>> protocolls (udp, icmp) are used.
>> This system used multiple routing tables and rules generated by myself, 
>> strongswan and netifd.
>>
>> If interested I can provide a testing ground and help in debugging.
>> Simply unload the module nf_conntrack_rtcache.ko helped immediately and the 
>> packet loss disappared.
>
> 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 
>
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -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;
>



Mit freundlichen Grüßen
 André Valentin
Systemadministrator
--
MarcanT GmbH, Ravensberger Str. 10 G, D - 33602 Bielefeld
Fon: +49 (521) 95945-0 | Fax: +49 (521) 95945-18
URL: http://www.marcant.net | http://www.global-m2m.com

Internet * Netzwerk * Mobile Daten
Citrix Silver Solution Advisor

Geschäftsführer: Thorsten Hojas
Handelsregister: AG Bielefeld, HRB 35827 USt-ID Nr.: DE 190203238
___
Ausserhalb unserer Geschäftszeiten (Montag bis Freitag von 8:30 Uhr bis
17:30 Uhr, ausgenommen gesetzliche Feiertage in NRW) stehen wir Ihnen
gemäß Ihrer jeweiligen Service-Level-Agreements unter der Ihnen
mitgeteilten Telefonnummer für Störungen und Notfälle zur Verfügung.
Sie können natürlich auch gerne jederzeit unter supp...@marcant.net ein
Ticket eröffnen, welches am nächsten Arbeitstag bearbeitet wird.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][ar71xx] Mikrotik Routerboard RB2011 switch fix

2014-12-23 Thread Matt Lee
Hi David,

I tested on 2011UiAS-2HnD and 2011UAS-2HnD, and for me, this works better
with pll_1000 set to 0x6f00.  But I have to make more testing.

I will conitnue testing...

Thanks





On Tue, Dec 23, 2014 at 1:57 PM, David Hutchison 
wrote:

> Hello,
>
> Can you try: ath79_eth0_pll_data.pll_1000 = 0x6f000;
>
> This is the value I originally found on the 951G, I tried to toggle as
> many bits as possible and narrow down from there. John Crispin found
> some documentation and we narrowed it down to 0x3e00 for the 951G.
> He is actually working on a patch that will grab the correct
> ath79_eth0_pll_data.pll_1000 value from the bootloader. That way this
> becomes dynamic. I do not know the progress he has made on it.
>
> http://comments.gmane.org/gmane.comp.embedded.openwrt.devel/28589
>
> Here is our original thread, where John posted the relevant datasheet.
> You can take the same approach we did, and narrow down to find your
> correct bits.
>
> It may also be easier to wait for his patch where he will dynamically set
> it.
>
> Hope this helps,
>
> -- Davey
>
> On Tue, Dec 23, 2014 at 11:23 AM, Matt Lee  wrote:
> > Hi Chris,
> >
> >>This patch is the same as the Routerboard 951G fix, I've built this
> >>and tested it on my rb-2011uias-2hnd.  However we should check that it
> >>also works on other/older RB2011 routers which did work OK with the
> >>unpatched code.
> >>
> >>diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
> >>b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
> >>index b73fae6..951ab94 100644
> >>--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
> >>+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
> >>@@ -270,6 +270,7 @@ static int __init rb2011_setup(u32 flags)
> >>rb2011_nand_init();
> >>
> >>ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
> >>+   AR934X_ETH_CFG_RXD_DELAY |
> >>   AR934X_ETH_CFG_SW_ONLY_MODE);
> >>
> >>ath79_register_mdio(1, 0x0);
> >>@@ -283,7 +284,7 @@ static int __init rb2011_setup(u32 flags)
> >>ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
> >>ath79_eth0_data.phy_mask = BIT(0);
> >>ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
> >>-   ath79_eth0_pll_data.pll_1000 = 0x0600;
> >>+   ath79_eth0_pll_data.pll_1000 = 0x3e00;
> >>
> >>ath79_register_eth(0);
> >>
> >>--
> >>Chris Green
> > This patch is not working correctly for me on the 2011UiAS-2HnD.  Many
> > packets are dropped, and I can see many FCS Errors and RxBadByte.
> >
> > root@OpenWrt:/# swconfig dev ag71xx-mdio.0 port 0 show
> > Port 0:
> > mib: Port 0 MIB counters
> > RxBroad : 8
> > RxPause : 0
> > RxMulti : 15
> > RxFcsErr: 800
> > RxAlignErr  : 0
> > RxRunt  : 0
> > RxFragment  : 0
> > Rx64Byte: 7
> > Rx128Byte   : 17323
> > Rx256Byte   : 6
> > Rx512Byte   : 9
> > Rx1024Byte  : 0
> > Rx1518Byte  : 0
> > RxMaxByte   : 0
> > RxTooLong   : 0
> > RxGoodByte  : 1145334
> > RxBadByte   : 65266
> > RxOverFlow  : 0
> > Filtered: 11
> > TxBroad : 244
> > TxPause : 0
> > TxMulti : 170
> > TxUnderRun  : 0
> > Tx64Byte: 21
> > Tx128Byte   : 360
> > Tx256Byte   : 20
> > Tx512Byte   : 44
> > Tx1024Byte  : 14459
> > Tx1518Byte  : 3
> > TxMaxByte   : 5683
> > TxOverSize  : 0
> > TxByte  : 16836688
> > TxCollision : 0
> > TxAbortCol  : 0
> > TxMultiCol  : 0
> > TxSingleCol : 0
> > TxExcDefer  : 0
> > TxDefer : 0
> > TxLateCol   : 0
> > pvid: 0
> > link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
> >
> > How can we determine the right value for the
> ath79_eth0_pll_data.pll_1000 ?
> >
> > -matt
> >
> >
> > ___
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> >
>
___
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 
---
 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] Wiki upload rights

2014-12-23 Thread valent.turko...@gmail.com
Hi,
wiki admins please enable upload rights for "valentt" account so that I can
continue contributing to wiki.

Thanks,
Valent.
___
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: rework reading volumes

2014-12-23 Thread Rafał Miłecki
UBI volume IDs don't have to be contiguous, this may happen if there
were few and the not last one was removed. In such case we may have
e.g. ubi0_0, ubi0_2.
It means we can't simply read value from "volumes_count" and iterate
from 0 to the count - 1.

This patch rewrites ubi_part_match to read whole directory and look
for ubi%d_%d entries in it.

Signed-off-by: Rafał Miłecki 
---
 libfstools/ubi.c | 26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/libfstools/ubi.c b/libfstools/ubi.c
index ac9eb1b..0f6e37a 100644
--- a/libfstools/ubi.c
+++ b/libfstools/ubi.c
@@ -165,22 +165,34 @@ static int ubi_volume_match(struct volume *v, char *name, 
int ubi_num, int volid
 
 static int ubi_part_match(struct volume *v, char *name, unsigned int ubi_num)
 {
-   unsigned int i, volumes_count;
+   DIR *ubi_dir;
+   struct dirent *ubi_dirent;
+   unsigned int volid;
char devdir[BUFLEN];
+   int ret = -1;
 
snprintf(devdir, sizeof(devdir), "%s/ubi%u",
ubi_dir_name, ubi_num);
 
-   if (read_uint_from_file(devdir, "volumes_count", &volumes_count))
-   return -1;
+   ubi_dir = opendir(devdir);
+   if (!ubi_dir)
+   return ret;
 
-   for (i=0;id_name, "ubi", 3))
+   continue;
+
+   if (sscanf(ubi_dirent->d_name, "ubi%*u_%u", &volid) != 1)
+   continue;
+
+   if (!ubi_volume_match(v, name, ubi_num, volid)) {
+   ret = 0;
+   break;
}
}
+   closedir(ubi_dir);
 
-   return -1;
+   return ret;
 }
 
 static int ubi_volume_find(struct volume *v, char *name)
-- 
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 
---
 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 
>>
>>  #include 
>> +#include 
>>
>>  #include 
>>  #include 
>> @@ -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 
---
 .../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 
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+@@ -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  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));
>> }
>>



>> +
> 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