Re: [OpenWrt-Devel] Broken GPIO on MT7620 after commit 34ca34b32b02

2018-05-22 Thread Kristian Evensen
Hi,

On Tue, May 22, 2018 at 1:33 PM, Rosen Penev  wrote:
> Looks like it's this commit:
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/staging/mt7621-mmc?h=next-20180517&id=b734735fcaca60e8f07b040cd8a700f6fabe5b39
>
> Please try reverting. Unfortunately I don't have mt7620 hardware so I
> can't test. Based on the comment, the issue should be fixed elsewhere.

Unless anyone beats me to it, I can test this on Friday or during the weekend.

BR,
Kristian

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Broken GPIO on MT7620 after commit 34ca34b32b02

2018-05-22 Thread Rosen Penev
On Tue, May 22, 2018 at 7:45 AM, Kristian Evensen
 wrote:
> Hi,
>
> On Tue, May 22, 2018 at 4:33 PM, John Crispin  wrote:
>> what exactly is the issue ? breaking compat means that rosen either needs to
>> fix the regression or we need to revert the patch.
>
> The issue I saw is that writing to GPIO has no effect. On my device
> (mt7620-based), I can control the power to the two mini-pcie slots by
> writing to /sys/class/gpio/power_pcie{1,2}/value. After the commit
> "ramips: mmc: Sync with
> staging driver", writing to these two files have no effect. I.e., I
> can no longer control the power.
Looks like it's this commit:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/staging/mt7621-mmc?h=next-20180517&id=b734735fcaca60e8f07b040cd8a700f6fabe5b39

Please try reverting. Unfortunately I don't have mt7620 hardware so I
can't test. Based on the comment, the issue should be fixed elsewhere.
>
> I see I used the wrong has in my original email, the correct sha of
> the commit is fec205f6544a.
>
> BR,
> Kristian

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] brcm47xx: add switch port mapping to Asus WL-500W

2018-05-22 Thread Mirko Parthey
Switch ports 0..3 are connected to external ports LAN{1..4} in sequence,
switch port 4 is not used, and switch port 5 is connected to the CPU.
The WAN port is attached to the CPU's second network interface; it has no
connection to the internal switch.

Reuse the "Dell TrueMobile 2300" entry, which describes the same mapping.

Signed-off-by: Mirko Parthey 
---
This patch is an update to https://patchwork.ozlabs.org/patch/734831/

Changes since v1:
* resubmit because patch was dropped from patchwork
* update commit message to match similar patches
* rebase on master and test again

 target/linux/brcm47xx/base-files/etc/board.d/01_detect | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/brcm47xx/base-files/etc/board.d/01_detect 
b/target/linux/brcm47xx/base-files/etc/board.d/01_detect
index 1860407..2373145 100755
--- a/target/linux/brcm47xx/base-files/etc/board.d/01_detect
+++ b/target/linux/brcm47xx/base-files/etc/board.d/01_detect
@@ -139,7 +139,6 @@ detect_by_model() {
;;
 
"Asus WL500G" | \
-   "Asus WL500W" | \
"Microsoft MN-700")
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -159,6 +158,7 @@ detect_by_model() {
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "5@eth0"
;;
 
+   "Asus WL500W" | \
"Dell TrueMobile 2300")
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
-- 
2.1.4


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 2/2] fstools: allow the mounting with full access time accounting

2018-05-22 Thread John Crispin



On 22/05/18 19:04, Pierre Lebleu wrote:

In order to allow the mounting of the filesystem with full access time
accounting, a new CMake option (eg: CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
has been added.

Signed-off-by: Pierre Lebleu 
---
v2: change the option name
  CMakeLists.txt   | 6 ++
  libfstools/overlay.c | 2 +-
  2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b98ba6..dead65f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,12 @@ ELSE(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL)
  ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
  
+IF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)

+   ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_RELATIME)
+ELSE(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+   ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_NOATIME)
+ENDIF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+

same comment applies here as for 1/2
    John


  ADD_EXECUTABLE(mount_root mount_root.c)
  TARGET_LINK_LIBRARIES(mount_root fstools)
  INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index 5d5a985..b201679 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v)
return -1;
}
  
-	if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, OVL_MOUNT_OPTION)) {

+   if (mount(v->blk, "/tmp/overlay", fstype, OVL_MOUNT_FLAGS, 
OVL_MOUNT_OPTION)) {
ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n",
 fstype, v->blk);
return -1;



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 1/2] fstools: allow to compress the filesystem

2018-05-22 Thread John Crispin



On 22/05/18 19:04, Pierre Lebleu wrote:

In order to allow the mounting of the filesystem with the zlib compression,
a new CMake option (eg: CMAKE_OVL_MOUNT_COMPRESS_ZLIB) has been added.

Signed-off-by: Pierre Lebleu 
---
v2: change the option name
  CMakeLists.txt   | 6 ++
  libfstools/overlay.c | 2 +-
  2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e855bd..6b98ba6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,12 @@ INSTALL(FILES libubi/libubi-tiny.h libubi/libubi.h 
libubi/ubi-media.h
DESTINATION include
  )
  
+IF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)

+   ADD_DEFINITIONS(-DOVL_MOUNT_OPTION="compr=zlib")
+ELSE(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
+   ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL)
+ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)


modifying code like this is sub optimal. I'd prefer if we did a 
-DOVL_COMPR_ZLIB only



+
  ADD_EXECUTABLE(mount_root mount_root.c)
  TARGET_LINK_LIBRARIES(mount_root fstools)
  INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index ebc43f7..5d5a985 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v)
return -1;
}
  
-	if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, NULL)) {

+   if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, 
OVL_MOUNT_OPTION)) {


if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME,
#ifdef OVL_COMPR_ZLIB
  "compr=zlib"
#else
  NULL
#endif
  ))

John


ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n",
 fstype, v->blk);
return -1;



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] arc770: bump kernel to 4.14

2018-05-22 Thread John Crispin



On 22/05/18 17:56, Evgeniy Didin wrote:

Hello,

Now arc770 is no longer marked as "source-only".
Could you add this commit to master branch please?

Best regards,
Evgeniy Didin

On Tue, 2018-04-17 at 15:25 +0300, didin wrote:

Hello,

This patch, as I see in patchwork, is accepted but I can't
find it in https://github.com/openwrt/openwrt.
Is there any issues or questions with this patch?

Best regards,
Evgeniy Didin

On Mon, 2018-04-02 at 19:25 +0300, Evgeniy Didin wrote:

Update Linux kernel version from 4.9 to 4.14 for arc770.
config-4.14 was simply regenerated with "make kernel_menuconfig".

Signed-off-by: Evgeniy Didin 
Cc: Alexey Brodkin 
Cc: John Crispin 
---
  target/linux/arc770/Makefile   |  2 +-
  target/linux/arc770/{config-4.9 => config-4.14}| 47 --
  ...stmmac-Disable-frame-filtering-completely.patch |  0
  3 files changed, 26 insertions(+), 23 deletions(-)
  rename target/linux/arc770/{config-4.9 => config-4.14} (86%)
  rename target/linux/arc770/{patches-4.9 => 
patches-4.14}/700-stmmac-Disable-frame-filtering-completely.patch (100%)

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Hi,
please dont top post and resend what ever is pending. ITs currently not 
listed in patchwork.

    John



___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] kmod-sched-cake: RFC latest cake

2018-05-22 Thread Kevin Darbyshire-Bryant via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
This bumps to the latest & possibly greatest cake support for tc.
It's not without problems, the netlink api is used to transfer data
between userspace (tc) and kernel space (sch_cake kmod) and we've
started sending 64bit values across it.

For reasons we don't understand, this is fine on some platforms and not
so good on others. e.g. tc -s qdisc show dev net_device_running_cake
won't return all the tin stats on some archs (MIPS r32 BE).

Assistance required!  Bug in openwrt?  Bug in our code?  Endian issue?

Signed-off-by: Kevin Darbyshire-Bryant 
---
 package/kernel/kmod-sched-cake/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/kmod-sched-cake/Makefile 
b/package/kernel/kmod-sched-cake/Makefile
index ad49bdaa19..6a20c4bc55 100644
--- a/package/kernel/kmod-sched-cake/Makefile
+++ b/package/kernel/kmod-sched-cake/Makefile
@@ -13,9 +13,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
-PKG_SOURCE_DATE:=2018-05-15
-PKG_SOURCE_VERSION:=779e91a91e803cf2b95a6a46de721d3a4fd4dfe6
-PKG_MIRROR_HASH:=2bd1e9aee6d53a2a140ad5ece6d8eeccbfb8ae8c788e84f9dd946e29abb64010
+PKG_SOURCE_DATE:=2018-05-22
+PKG_SOURCE_VERSION:=f65daf6756826c9a4a11dac2d98b68c152e9619d
+PKG_MIRROR_HASH:=c68368923e7ba29f86aec992a19e8831af0915f578c23196bba3a3ffb9d77b1e
 PKG_MAINTAINER:=Kevin Darbyshire-Bryant 
 
 include $(INCLUDE_DIR)/package.mk
-- 
2.15.1 (Apple Git-101)


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] iproute2: RFC update cake support

2018-05-22 Thread Kevin Darbyshire-Bryant via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
This bumps to the latest & possibly greatest cake support for tc.
It's not without problems, the netlink api is used to transfer data
between userspace (tc) and kernel space (sch_cake kmod) and we've
started sending 64bit values across it.

For reasons we don't understand, this is fine on some platforms and not
so good on others. e.g. tc -s qdisc show dev net_device_running_cake
won't return all the tin stats on some archs (MIPS r32 BE).

Assistance required!  Bug in openwrt?  Bug in our code?  Endian issue?

Signed-off-by: Kevin Darbyshire-Bryant 
---
 .../iproute2/patches/950-add-cake-to-tc.patch  | 111 +++--
 1 file changed, 83 insertions(+), 28 deletions(-)

diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch 
b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch
index 3c2cdaaac3..f453af9d2e 100644
--- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch
+++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch
@@ -1,13 +1,14 @@
 --- a/include/uapi/linux/pkt_sched.h
 +++ b/include/uapi/linux/pkt_sched.h
-@@ -934,4 +934,110 @@ enum {
+@@ -934,4 +934,118 @@ enum {
  
  #define TCA_CBS_MAX (__TCA_CBS_MAX - 1)
  
 +/* CAKE */
 +enum {
 +  TCA_CAKE_UNSPEC,
-+  TCA_CAKE_BASE_RATE,
++  TCA_CAKE_PAD,
++  TCA_CAKE_BASE_RATE64,
 +  TCA_CAKE_DIFFSERV_MODE,
 +  TCA_CAKE_ATM,
 +  TCA_CAKE_FLOW_MODE,
@@ -29,7 +30,8 @@
 +
 +enum {
 +  __TCA_CAKE_STATS_INVALID,
-+  TCA_CAKE_STATS_CAPACITY_ESTIMATE,
++  TCA_CAKE_STATS_PAD,
++  TCA_CAKE_STATS_CAPACITY_ESTIMATE64,
 +  TCA_CAKE_STATS_MEMORY_LIMIT,
 +  TCA_CAKE_STATS_MEMORY_USED,
 +  TCA_CAKE_STATS_AVG_NETOFF,
@@ -38,6 +40,12 @@
 +  TCA_CAKE_STATS_MIN_ADJLEN,
 +  TCA_CAKE_STATS_MAX_ADJLEN,
 +  TCA_CAKE_STATS_TIN_STATS,
++  TCA_CAKE_STATS_DEFICIT,
++  TCA_CAKE_STATS_COBALT_COUNT,
++  TCA_CAKE_STATS_DROPPING,
++  TCA_CAKE_STATS_DROP_NEXT_US,
++  TCA_CAKE_STATS_P_DROP,
++  TCA_CAKE_STATS_BLUE_TIMER_US,
 +  __TCA_CAKE_STATS_MAX
 +};
 +#define TCA_CAKE_STATS_MAX (__TCA_CAKE_STATS_MAX - 1)
@@ -54,8 +62,8 @@
 +  TCA_CAKE_TIN_STATS_ECN_MARKED_PACKETS,
 +  TCA_CAKE_TIN_STATS_ECN_MARKED_BYTES64,
 +  TCA_CAKE_TIN_STATS_BACKLOG_PACKETS,
-+  TCA_CAKE_TIN_STATS_BACKLOG_BYTES64,
-+  TCA_CAKE_TIN_STATS_THRESHOLD_RATE,
++  TCA_CAKE_TIN_STATS_BACKLOG_BYTES,
++  TCA_CAKE_TIN_STATS_THRESHOLD_RATE64,
 +  TCA_CAKE_TIN_STATS_TARGET_US,
 +  TCA_CAKE_TIN_STATS_INTERVAL_US,
 +  TCA_CAKE_TIN_STATS_WAY_INDIRECT_HITS,
@@ -758,7 +766,7 @@
  TCMODULES += q_hhf.o
 --- /dev/null
 +++ b/tc/q_cake.c
-@@ -0,0 +1,749 @@
+@@ -0,0 +1,796 @@
 +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
 +/*
 + * Common Applications Kept Enhanced  --  CAKE
@@ -831,7 +839,7 @@
 +struct nlmsghdr *n, const char *dev)
 +{
 +  int unlimited = 0;
-+  unsigned bandwidth = 0;
++  __u64 bandwidth = 0;
 +  unsigned interval = 0;
 +  unsigned target = 0;
 +  unsigned diffserv = 0;
@@ -853,7 +861,7 @@
 +  while (argc > 0) {
 +  if (strcmp(*argv, "bandwidth") == 0) {
 +  NEXT_ARG();
-+  if (get_rate(&bandwidth, *argv)) {
++  if (get_rate64(&bandwidth, *argv)) {
 +  fprintf(stderr, "Illegal \"bandwidth\"\n");
 +  return -1;
 +  }
@@ -1088,7 +1096,7 @@
 +  tail = NLMSG_TAIL(n);
 +  addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
 +  if (bandwidth || unlimited)
-+  addattr_l(n, 1024, TCA_CAKE_BASE_RATE, &bandwidth, 
sizeof(bandwidth));
++  addattr_l(n, 1024, TCA_CAKE_BASE_RATE64, &bandwidth, 
sizeof(bandwidth));
 +  if (diffserv)
 +  addattr_l(n, 1024, TCA_CAKE_DIFFSERV_MODE, &diffserv, 
sizeof(diffserv));
 +  if (atm != -1)
@@ -1128,7 +1136,7 @@
 +static int cake_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 +{
 +  struct rtattr *tb[TCA_CAKE_MAX + 1];
-+  unsigned bandwidth = 0;
++  __u64 bandwidth = 0;
 +  unsigned diffserv = 0;
 +  unsigned flowmode = 0;
 +  unsigned interval = 0;
@@ -1151,9 +1159,9 @@
 +
 +  parse_rtattr_nested(tb, TCA_CAKE_MAX, opt);
 +
-+  if (tb[TCA_CAKE_BASE_RATE] &&
-+  RTA_PAYLOAD(tb[TCA_CAKE_BASE_RATE]) >= sizeof(__u32)) {
-+  bandwidth = rta_getattr_u32(tb[TCA_CAKE_BASE_RATE]);
++  if (tb[TCA_CAKE_BASE_RATE64] &&
++  RTA_PAYLOAD(tb[TCA_CAKE_BASE_RATE64]) >= sizeof(bandwidth)) {
++  bandwidth = rta_getattr_u64(tb[TCA_CAKE_BASE_RATE64]);
 +  if(bandwidth) {
 +  pr

[OpenWrt-Devel] [PATCH 0/2] RFC bumps to latest cake

2018-05-22 Thread Kevin Darbyshire-Bryant via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
This bumps to the latest & possibly greatest cake support for tc.
It's not without problems, the netlink api is used to transfer data
between userspace (tc) and kernel space (sch_cake kmod) and we've
started sending 64bit values across it.

For reasons we don't understand, this is fine on some platforms and not
so good on others. e.g. tc -s qdisc show dev net_device_running_cake
won't return all the tin stats on some archs (MIPS r32 BE).

Assistance required!  Bug in openwrt?  Bug in our code?  Endian issue?

Testing, reports, ideas, fixes especially welcome :-)

Kevin Darbyshire-Bryant (2):
  iproute2: RFC update cake support
  kmod-sched-cake: RFC latest cake

 package/kernel/kmod-sched-cake/Makefile|   6 +-
 .../iproute2/patches/950-add-cake-to-tc.patch  | 111 +++--
 2 files changed, 86 insertions(+), 31 deletions(-)

-- 
2.15.1 (Apple Git-101)


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 2/2] fstools: allow the mounting with full access time accounting

2018-05-22 Thread Pierre Lebleu
In order to allow the mounting of the filesystem with full access time
accounting, a new CMake option (eg: CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
has been added.

Signed-off-by: Pierre Lebleu 
---
v2: change the option name
 CMakeLists.txt   | 6 ++
 libfstools/overlay.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b98ba6..dead65f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,12 @@ ELSE(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
ADD_DEFINITIONS(-DOVL_MOUNT_OPTION=NULL)
 ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
 
+IF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+   ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_RELATIME)
+ELSE(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+   ADD_DEFINITIONS(-DOVL_MOUNT_FLAGS=MS_NOATIME)
+ENDIF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
+
 ADD_EXECUTABLE(mount_root mount_root.c)
 TARGET_LINK_LIBRARIES(mount_root fstools)
 INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index 5d5a985..b201679 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -341,7 +341,7 @@ static int overlay_mount_fs(struct volume *v)
return -1;
}
 
-   if (mount(v->blk, "/tmp/overlay", fstype, MS_NOATIME, 
OVL_MOUNT_OPTION)) {
+   if (mount(v->blk, "/tmp/overlay", fstype, OVL_MOUNT_FLAGS, 
OVL_MOUNT_OPTION)) {
ULOG_ERR("failed to mount -t %s %s /tmp/overlay: %m\n",
 fstype, v->blk);
return -1;
-- 
1.9.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Broken GPIO on MT7620 after commit 34ca34b32b02

2018-05-22 Thread Rosen Penev
On Tue, May 22, 2018 at 7:33 AM, John Crispin  wrote:
>
>
> On 22/05/18 16:18, Kristian Evensen wrote:
>>
>> On Sun, May 20, 2018 at 10:26 PM, Rosen Penev  wrote:

 Bisecting further is hard, since the
 commit is a combination of (a lot of) clean-up and some functional
 changes.
>>>
>>> Changes can be viewed on the linux-next tree. It should be as simple
>>> as dropping in the relevant files to the files-4.14 directory.
>>>
 Would it be possible to revert the commit and split it in two
 parts (clean-up + functional)? Then it should be easier to figure out
 what is wrong.
>>>
>>> I'm torn on this. The long term solution is to migrate to the mainline
>>> mtk-sd driver (which is just a newer version of this one). The new
>>> 18.06 release does not contain this patch.
>>
>> I agree that using the mainline driver is ideal. This email was meant
>> more as a notification that the commit creates issues for some
>> devices. I didnt test, but I guess that my LEDs are also broken, since
>> some are also controlled using GPIO. For me, reverting the commit
>> locally works fine and I can carry that locally.
>>
>> BR,
>> Kristian
>
>
> what exactly is the issue ? breaking compat means that rosen either needs to
> fix the regression or we need to revert the patch.
I will look into this later today. I'm simultaneously working on
getting the mainline driver up and running on mt7621. Will submit an
RFC for that soon.
>
> John

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] arc770: bump kernel to 4.14

2018-05-22 Thread Evgeniy Didin
Hello,

Now arc770 is no longer marked as "source-only". 
Could you add this commit to master branch please?

Best regards, 
Evgeniy Didin

On Tue, 2018-04-17 at 15:25 +0300, didin wrote:
> Hello,
> 
> This patch, as I see in patchwork, is accepted but I can't 
> find it in https://github.com/openwrt/openwrt. 
> Is there any issues or questions with this patch?
> 
> Best regards, 
> Evgeniy Didin
> 
> On Mon, 2018-04-02 at 19:25 +0300, Evgeniy Didin wrote:
> > Update Linux kernel version from 4.9 to 4.14 for arc770.
> > config-4.14 was simply regenerated with "make kernel_menuconfig".
> > 
> > Signed-off-by: Evgeniy Didin 
> > Cc: Alexey Brodkin 
> > Cc: John Crispin 
> > ---
> >  target/linux/arc770/Makefile   |  2 +-
> >  target/linux/arc770/{config-4.9 => config-4.14}| 47 
> > --
> >  ...stmmac-Disable-frame-filtering-completely.patch |  0
> >  3 files changed, 26 insertions(+), 23 deletions(-)
> >  rename target/linux/arc770/{config-4.9 => config-4.14} (86%)
> >  rename target/linux/arc770/{patches-4.9 => 
> > patches-4.14}/700-stmmac-Disable-frame-filtering-completely.patch (100%)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Broken GPIO on MT7620 after commit 34ca34b32b02

2018-05-22 Thread Kristian Evensen
Hi,

On Tue, May 22, 2018 at 4:33 PM, John Crispin  wrote:
> what exactly is the issue ? breaking compat means that rosen either needs to
> fix the regression or we need to revert the patch.

The issue I saw is that writing to GPIO has no effect. On my device
(mt7620-based), I can control the power to the two mini-pcie slots by
writing to /sys/class/gpio/power_pcie{1,2}/value. After the commit
"ramips: mmc: Sync with
staging driver", writing to these two files have no effect. I.e., I
can no longer control the power.

I see I used the wrong has in my original email, the correct sha of
the commit is fec205f6544a.

BR,
Kristian

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Broken GPIO on MT7620 after commit 34ca34b32b02

2018-05-22 Thread John Crispin



On 22/05/18 16:18, Kristian Evensen wrote:

On Sun, May 20, 2018 at 10:26 PM, Rosen Penev  wrote:

Bisecting further is hard, since the
commit is a combination of (a lot of) clean-up and some functional
changes.

Changes can be viewed on the linux-next tree. It should be as simple
as dropping in the relevant files to the files-4.14 directory.


Would it be possible to revert the commit and split it in two
parts (clean-up + functional)? Then it should be easier to figure out
what is wrong.

I'm torn on this. The long term solution is to migrate to the mainline
mtk-sd driver (which is just a newer version of this one). The new
18.06 release does not contain this patch.

I agree that using the mainline driver is ideal. This email was meant
more as a notification that the commit creates issues for some
devices. I didnt test, but I guess that my LEDs are also broken, since
some are also controlled using GPIO. For me, reverting the commit
locally works fine and I can carry that locally.

BR,
Kristian


what exactly is the issue ? breaking compat means that rosen either 
needs to fix the regression or we need to revert the patch.


    John

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Broken GPIO on MT7620 after commit 34ca34b32b02

2018-05-22 Thread Kristian Evensen
On Sun, May 20, 2018 at 10:26 PM, Rosen Penev  wrote:
>> Bisecting further is hard, since the
>> commit is a combination of (a lot of) clean-up and some functional
>> changes.
> Changes can be viewed on the linux-next tree. It should be as simple
> as dropping in the relevant files to the files-4.14 directory.
>
>> Would it be possible to revert the commit and split it in two
>> parts (clean-up + functional)? Then it should be easier to figure out
>> what is wrong.
> I'm torn on this. The long term solution is to migrate to the mainline
> mtk-sd driver (which is just a newer version of this one). The new
> 18.06 release does not contain this patch.

I agree that using the mainline driver is ideal. This email was meant
more as a notification that the commit creates issues for some
devices. I didnt test, but I guess that my LEDs are also broken, since
some are also controlled using GPIO. For me, reverting the commit
locally works fine and I can carry that locally.

BR,
Kristian

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] 18.06 Bug: HW Flow Offload + Wireguard Bug

2018-05-22 Thread Jaap Buurman
Dear Felix & others,

I am currently running a 18.06 snapshot image to start testing the
stability of the firmware and new features, including the lovely
hardware flow offload. While it is working extremely well (I am
finally able to max out my connection, but with hardly any CPU load!),
pushing data through Wireguard instantly crashes my router whenever hw
flow offload is enabled. There is another report of this issue on the
forum, including a call trace:
https://forum.lede-project.org/t/netfilter-flow-offload-hw-nat/10237/44?u=mushoz

If you need any additional information or require my help testing,
please do not hesitate to contact me.

Yours sincerely,

Jaap Buurman

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Fwd: 18.06 Bug: Baby Jumbo Frames on mt7621

2018-05-22 Thread Jaap Buurman
Dear all,

The switch to the 4.14 kernel apparently broke the baby jumbo frames
support of 2048 bytes that the switch is capable off. I found out that
changing the mtu above 1500 via Luci no longer applies properly.
Trying to manually change the mtu via ssh also fails:

root@LEDE:~# ifconfig eth0 mtu 1508 up
ifconfig: SIOCSIFMTU: Invalid argument

If there is any additional information that I can supply, please let
me know. I am also more than willing to help test potential fixes :)

Yours sincerely,

Jaap Buurman

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] kernel: bump 4.9 to 4.9.101

2018-05-22 Thread Koen Vandeputte
Refreshed all patches

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte 
---
 include/kernel-version.mk  |  4 ++--
 .../090-net-generalize-napi_complete_done.patch|  4 ++--
 .../479-mtd-spi-nor-add-eon-en25qh32.patch |  2 +-
 .../patches-4.9/105-mtd-nor-add-mx25l25635f.patch  |  2 +-
 .../401-mtd-spi-nor-support-layerscape.patch   | 24 +++---
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 7aa9bdaae4e7..73ccbf91ccaf 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,13 +4,13 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .121
-LINUX_VERSION-4.9 = .100
 LINUX_VERSION-4.14 = .41
+LINUX_VERSION-4.9 = .101
 
 LINUX_KERNEL_HASH-3.18.71 = 
5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.121 = 
44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
-LINUX_KERNEL_HASH-4.9.100 = 
c5bb6f3a7113e05cbaf6e48b2b485dea4f7edae5e42b3fe81c963ba63413a77c
 LINUX_KERNEL_HASH-4.14.41 = 
ccf1147a9b05c986728bc9fa1b407e029c23a16c9f915134dc3f6f8663d8ce6d
+LINUX_KERNEL_HASH-4.9.101 = 
af95d02b07e900ec4a49670aa2c9d95bf3238748c908cf506ce77aeaa5e7aa00
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst 
-,_,$(subst /,_,$(1)))
diff --git 
a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch 
b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
index 8d51e1b1df47..ea703839f133 100644
--- 
a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
+++ 
b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
@@ -1040,7 +1040,7 @@ Signed-off-by: David S. Miller 
writel(irq->mask, adpt->base + EMAC_INT_MASK);
 --- a/drivers/net/ethernet/realtek/r8169.c
 +++ b/drivers/net/ethernet/realtek/r8169.c
-@@ -7574,7 +7574,7 @@ static int rtl8169_poll(struct napi_stru
+@@ -7577,7 +7577,7 @@ static int rtl8169_poll(struct napi_stru
}
  
if (work_done < budget) {
@@ -1106,7 +1106,7 @@ Signed-off-by: David S. Miller 
return work_done;
 --- a/drivers/net/ethernet/sun/niu.c
 +++ b/drivers/net/ethernet/sun/niu.c
-@@ -3786,7 +3786,7 @@ static int niu_poll(struct napi_struct *
+@@ -3785,7 +3785,7 @@ static int niu_poll(struct napi_struct *
work_done = niu_poll_core(np, lp, budget);
  
if (work_done < budget) {
diff --git 
a/target/linux/generic/pending-4.9/479-mtd-spi-nor-add-eon-en25qh32.patch 
b/target/linux/generic/pending-4.9/479-mtd-spi-nor-add-eon-en25qh32.patch
index 9e9e091a2efb..b8d51015149e 100644
--- a/target/linux/generic/pending-4.9/479-mtd-spi-nor-add-eon-en25qh32.patch
+++ b/target/linux/generic/pending-4.9/479-mtd-spi-nor-add-eon-en25qh32.patch
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1007,6 +1007,7 @@
+@@ -955,6 +955,7 @@ static const struct flash_info spi_nor_i
{ "en25p64",INFO(0x1c2017, 0, 64 * 1024,  128, 0) },
{ "en25q64",INFO(0x1c3017, 0, 64 * 1024,  128, SECT_4K) },
{ "en25q128",   INFO(0x1c3018, 0, 64 * 1024,  256, SECT_4K) },
diff --git a/target/linux/ipq806x/patches-4.9/105-mtd-nor-add-mx25l25635f.patch 
b/target/linux/ipq806x/patches-4.9/105-mtd-nor-add-mx25l25635f.patch
index edfafda48c5f..21ec00b7921e 100644
--- a/target/linux/ipq806x/patches-4.9/105-mtd-nor-add-mx25l25635f.patch
+++ b/target/linux/ipq806x/patches-4.9/105-mtd-nor-add-mx25l25635f.patch
@@ -11,7 +11,7 @@ the ubi volume created by the other.
 ---
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1018,7 +1018,7 @@ static const struct flash_info spi_nor_i
+@@ -1019,7 +1019,7 @@ static const struct flash_info spi_nor_i
{ "mx25u6435f",  INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
{ "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) },
{ "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
diff --git 
a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch 
b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
index 9d849686080c..e8fc1ec2ba30 100644
--- 
a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
+++ 
b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
@@ -705,7 +705,7 @@ Signed-off-by: Yangbo Lu 
case SPI_NOR_NORMAL:
return 0;
}
-@@ -961,6 +973,8 @@ static const struct flash_info spi_nor_i
+@@ -962,6 +974,8 @@ static const struct flash_info spi_nor_i
  
/* ESMT */
{ "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K | 
SPI_NOR_HAS_LOCK) },
@@ -714,7 +714,7 @@ Signed-off-by: Yangbo Lu 
  
/* Everspin */
{ "mr25h256", CAT25_INFO( 32 * 1024, 1,

[OpenWrt-Devel] [PATCH 2/2] kernel: bump 4.14 to 4.14.42

2018-05-22 Thread Koen Vandeputte
Refreshed all patches

Compile-tested on: cns3xxx, imx6, x86_64
Runtime-tested on: cns3xxx, imx6, x86_64

Signed-off-by: Koen Vandeputte 
---

Contains an important fix for UDP sockets!  ("udp: fix SO_BINDTODEVICE")


 include/kernel-version.mk|  4 ++--
 ...or-detect-JEDEC-incompatible-w25q128-using-.patch |  2 +-
 ...rejecting-with-source-address-failed-policy.patch | 20 ++--
 ...1-mtd-nor-support-mtd-name-from-device-tree.patch |  4 ++--
 ...0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch | 12 ++--
 .../patches-4.14/302-spi-nor-add-gd25q512.patch  |  2 +-
 ...3-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch |  2 +-
 7 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 73ccbf91ccaf..0566f1c3f8cf 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,13 +4,13 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .121
-LINUX_VERSION-4.14 = .41
 LINUX_VERSION-4.9 = .101
+LINUX_VERSION-4.14 = .42
 
 LINUX_KERNEL_HASH-3.18.71 = 
5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.121 = 
44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
-LINUX_KERNEL_HASH-4.14.41 = 
ccf1147a9b05c986728bc9fa1b407e029c23a16c9f915134dc3f6f8663d8ce6d
 LINUX_KERNEL_HASH-4.9.101 = 
af95d02b07e900ec4a49670aa2c9d95bf3238748c908cf506ce77aeaa5e7aa00
+LINUX_KERNEL_HASH-4.14.42 = 
2b03106f99e24a79ccf81be56f95129521d4e25f5421a1150ad278ae9a479003
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst 
-,_,$(subst /,_,$(1)))
diff --git 
a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
 
b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
index 8eb70b4e53e4..832e0d1fe544 100644
--- 
a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
+++ 
b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch
@@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki 
 
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1209,6 +1209,18 @@ static const struct flash_info *spi_nor_
+@@ -1210,6 +1210,18 @@ static const struct flash_info *spi_nor_
}
dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n",
id[0], id[1], id[2]);
diff --git 
a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
 
b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index 45f387f2690b..7e7a6a44e289 100644
--- 
a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ 
b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -141,7 +141,7 @@ Signed-off-by: Jonas Gorski 
  static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__refcnt   = ATOMIC_INIT(1),
-@@ -2041,6 +2058,11 @@ static struct rt6_info *ip6_route_info_c
+@@ -2046,6 +2063,11 @@ static struct rt6_info *ip6_route_info_c
rt->dst.output = ip6_pkt_prohibit_out;
rt->dst.input = ip6_pkt_prohibit;
break;
@@ -153,7 +153,7 @@ Signed-off-by: Jonas Gorski 
case RTN_THROW:
case RTN_UNREACHABLE:
default:
-@@ -2766,6 +2788,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -2771,6 +2793,17 @@ static int ip6_pkt_prohibit_out(struct n
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, 
IPSTATS_MIB_OUTNOROUTES);
  }
  
@@ -171,7 +171,7 @@ Signed-off-by: Jonas Gorski 
  /*
   *Allocate a dst for local (unicast / anycast) address.
   */
-@@ -3002,7 +3035,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -3007,7 +3040,8 @@ static int rtm_to_fib6_config(struct sk_
if (rtm->rtm_type == RTN_UNREACHABLE ||
rtm->rtm_type == RTN_BLACKHOLE ||
rtm->rtm_type == RTN_PROHIBIT ||
@@ -181,7 +181,7 @@ Signed-off-by: Jonas Gorski 
cfg->fc_flags |= RTF_REJECT;
  
if (rtm->rtm_type == RTN_LOCAL)
-@@ -3492,6 +3526,9 @@ static int rt6_fill_node(struct net *net
+@@ -3497,6 +3531,9 @@ static int rt6_fill_node(struct net *net
case -EACCES:
rtm->rtm_type = RTN_PROHIBIT;
break;
@@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski 
case -EAGAIN:
rtm->rtm_type = RTN_THROW;
break;
-@@ -3810,6 +3847,8 @@ static int ip6_route_dev_notify(struct n
+@@ -3815,6 +3852,8 @@ static int ip6_route_dev_notify(struct n
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.ip6_prohibit_e

[OpenWrt-Devel] [PATCH 4/4] ustream-ssl: openssl-1.1 compatibility

2018-05-22 Thread Eneas U de Queiroz via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Patch to compile ustream-ssl with openssl-1.1.0.

Signed-off-by: Eneas U de Queiroz 
---
 ustream-io-openssl.c | 37 +
 ustream-openssl.c| 12 +++-
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/ustream-io-openssl.c b/ustream-io-openssl.c
index 6711055..73a2ba6 100644
--- a/ustream-io-openssl.c
+++ b/ustream-io-openssl.c
@@ -26,10 +26,16 @@
 static int
 s_ustream_new(BIO *b)
 {
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   BIO_set_init(b, 1);
+   BIO_set_data(b, NULL);
+   BIO_set_shutdown(b, 0);
+#else
b->init = 1;
b->num = 0;
b->ptr = NULL;
b->flags = 0;
+#endif
return 1;
 }
 
@@ -39,9 +45,15 @@ s_ustream_free(BIO *b)
if (!b)
return 0;
 
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   BIO_set_data(b, NULL);
+   BIO_set_init(b, 0);
+   BIO_set_shutdown(b, 0);
+#else
b->ptr = NULL;
b->init = 0;
b->flags = 0;
+#endif
return 1;
 }
 
@@ -55,7 +67,11 @@ s_ustream_read(BIO *b, char *buf, int len)
if (!buf || len <= 0)
return 0;
 
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   s = (struct ustream *)BIO_get_data(b);
+#else
s = (struct ustream *)b->ptr;
+#endif
if (!s)
return 0;
 
@@ -84,7 +100,11 @@ s_ustream_write(BIO *b, const char *buf, int len)
if (!buf || len <= 0)
return 0;
 
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   s = (struct ustream *)BIO_get_data(b);
+#else
s = (struct ustream *)b->ptr;
+#endif
if (!s)
return 0;
 
@@ -116,6 +136,7 @@ static long s_ustream_ctrl(BIO *b, int cmd, long num, void 
*ptr)
};
 }
 
+#if OPENSSL_VERSION_NUMBER < 0x1010L
 static BIO_METHOD methods_ustream = {
100 | BIO_TYPE_SOURCE_SINK,
"ustream",
@@ -128,13 +149,29 @@ static BIO_METHOD methods_ustream = {
s_ustream_free,
NULL,
 };
+#endif
 
 static BIO *ustream_bio_new(struct ustream *s)
 {
BIO *bio;
 
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   BIO_METHOD *methods_ustream;
+
+   methods_ustream = BIO_meth_new(BIO_get_new_index() | 
BIO_TYPE_SOURCE_SINK, "ustream");
+   BIO_meth_set_write(methods_ustream, s_ustream_write);
+   BIO_meth_set_read(methods_ustream, s_ustream_read);
+   BIO_meth_set_puts(methods_ustream, s_ustream_puts);
+   BIO_meth_set_gets(methods_ustream, s_ustream_gets);
+   BIO_meth_set_ctrl(methods_ustream, s_ustream_ctrl);
+   BIO_meth_set_create(methods_ustream, s_ustream_new);
+   BIO_meth_set_destroy(methods_ustream, s_ustream_free);
+   bio = BIO_new(methods_ustream);
+   BIO_set_data(bio, s);
+#else
bio = BIO_new(&methods_ustream);
bio->ptr = s;
+#endif
return bio;
 }
 
diff --git a/ustream-openssl.c b/ustream-openssl.c
index eb03dab..52b7c21 100644
--- a/ustream-openssl.c
+++ b/ustream-openssl.c
@@ -38,11 +38,17 @@ __ustream_ssl_context_new(bool server)
if (server)
 #ifdef CYASSL_OPENSSL_H_
m = SSLv23_server_method();
+#elif OPENSSL_VERSION_NUMBER >= 0x1010L
+   m = TLS_server_method();
 #else
m = TLSv1_2_server_method();
 #endif
else
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   m = TLS_client_method();
+#else
m = SSLv23_client_method();
+#endif
 
c = SSL_CTX_new((void *) m);
if (!c)
@@ -52,8 +58,12 @@ __ustream_ssl_context_new(bool server)
 #ifndef OPENSSL_NO_ECDH
SSL_CTX_set_ecdh_auto(c, 1);
 #endif
-   if (server)
+   if (server) {
+#if OPENSSL_VERSION_NUMBER >= 0x1010L
+   SSL_CTX_set_min_proto_version(c, TLS1_2_VERSION);
+#endif
SSL_CTX_set_cipher_list(c, "DEFAULT:!RC4:@STRENGTH");
+   }
SSL_CTX_set_quiet_shutdown(c, 1);
 
return (void *) c;
-- 
2.16.1


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/4] adb: added patch for openssl 1.1.0 compatibility

2018-05-22 Thread Eneas U de Queiroz via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Signed-off-by: Eneas U de Queiroz 
---
 package/utils/adb/patches/010-openssl-1.1.patch | 28 +
 1 file changed, 28 insertions(+)
 create mode 100644 package/utils/adb/patches/010-openssl-1.1.patch

diff --git a/package/utils/adb/patches/010-openssl-1.1.patch 
b/package/utils/adb/patches/010-openssl-1.1.patch
new file mode 100644
index 00..e4df372a34
--- /dev/null
+++ b/package/utils/adb/patches/010-openssl-1.1.patch
@@ -0,0 +1,28 @@
+--- a/adb/adb_auth_host.c
 b/adb/adb_auth_host.c
+@@ -83,7 +83,13 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
+ }
+ 
+ BN_set_bit(r32, 32);
++#if OPENSSL_VERSION_NUMBER >= 0x1010L
++const BIGNUM *rsa_n, *rsa_e;
++RSA_get0_key(rsa, &rsa_n, &rsa_e, NULL);
++BN_copy(n, rsa_n);
++#else
+ BN_copy(n, rsa->n);
++#endif
+ BN_set_bit(r, RSANUMWORDS * 32);
+ BN_mod_sqr(rr, r, n, ctx);
+ BN_div(NULL, rem, n, r32, ctx);
+@@ -97,7 +103,11 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
+ BN_div(n, rem, n, r32, ctx);
+ pkey->n[i] = BN_get_word(rem);
+ }
++#if OPENSSL_VERSION_NUMBER >= 0x1010L
++pkey->exponent = BN_get_word(rsa_e);
++#else
+ pkey->exponent = BN_get_word(rsa->e);
++#endif
+ 
+ out:
+ BN_free(n0inv);
-- 
2.16.1


--- End Message ---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/4] openssl: Upgrade to 1.1.0h

2018-05-22 Thread Eneas U de Queiroz via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
This version brings major changes to the API, so many packages will need
adjustments or version bumps.

Signed-off-by: Eneas U de Queiroz 
---
 package/libs/openssl/Config.in |  10 --
 package/libs/openssl/Makefile  |  51 ++
 .../libs/openssl/patches/110-openwrt_targets.patch |  26 +++
 .../openssl/patches/110-optimize-for-size.patch|  16 --
 package/libs/openssl/patches/130-perl-path.patch   |  64 ---
 .../libs/openssl/patches/140-makefile-dirs.patch   |  11 --
 package/libs/openssl/patches/150-no_engines.patch  |  81 -
 .../openssl/patches/160-disable_doc_tests.patch|  58 ---
 package/libs/openssl/patches/170-bash_path.patch   |   8 -
 .../openssl/patches/180-fix_link_segfault.patch|  16 +-
 .../patches/190-remove_timestamp_check.patch   |  23 ---
 .../libs/openssl/patches/200-parallel_build.patch  | 184 -
 12 files changed, 50 insertions(+), 498 deletions(-)
 create mode 100644 package/libs/openssl/patches/110-openwrt_targets.patch
 delete mode 100644 package/libs/openssl/patches/110-optimize-for-size.patch
 delete mode 100644 package/libs/openssl/patches/130-perl-path.patch
 delete mode 100644 package/libs/openssl/patches/140-makefile-dirs.patch
 delete mode 100644 package/libs/openssl/patches/150-no_engines.patch
 delete mode 100644 package/libs/openssl/patches/160-disable_doc_tests.patch
 delete mode 100644 package/libs/openssl/patches/170-bash_path.patch
 delete mode 100644 
package/libs/openssl/patches/190-remove_timestamp_check.patch
 delete mode 100644 package/libs/openssl/patches/200-parallel_build.patch

diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in
index 96d3ba3e9d..fdad98fdf6 100644
--- a/package/libs/openssl/Config.in
+++ b/package/libs/openssl/Config.in
@@ -10,11 +10,6 @@ config OPENSSL_WITH_EC2M
 depends on OPENSSL_WITH_EC
 prompt "Enable ec2m support"
 
-config OPENSSL_WITH_SSL3
-   bool
-   default n
-   prompt "Enable sslv3 support"
-
 config OPENSSL_WITH_DEPRECATED
bool
default y
@@ -30,11 +25,6 @@ config OPENSSL_WITH_COMPRESSION
default n
prompt "Enable compression support"
 
-config OPENSSL_WITH_NPN
-   bool
-   default y
-   prompt "Enable NPN support"
-
 config OPENSSL_WITH_PSK
bool
default y
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 8409730d70..ba6577d915 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
-PKG_BASE:=1.0.2
-PKG_BUGFIX:=o
+PKG_BASE:=1.1.0
+PKG_BUGFIX:=h
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
@@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \
http://gd.tuwien.ac.at/infosys/security/openssl/source/ \
http://www.openssl.org/source/ \
http://www.openssl.org/source/old/$(PKG_BASE)/
-PKG_HASH:=ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d
+PKG_HASH:=5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE
@@ -34,12 +34,10 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_OPENSSL_ENGINE_DIGEST \
CONFIG_OPENSSL_WITH_EC \
CONFIG_OPENSSL_WITH_EC2M \
-   CONFIG_OPENSSL_WITH_SSL3 \
CONFIG_OPENSSL_HARDWARE_SUPPORT \
CONFIG_OPENSSL_WITH_DEPRECATED \
CONFIG_OPENSSL_WITH_DTLS \
CONFIG_OPENSSL_WITH_COMPRESSION \
-   CONFIG_OPENSSL_WITH_NPN \
CONFIG_OPENSSL_WITH_PSK \
CONFIG_OPENSSL_WITH_SRP \
CONFIG_OPENSSL_OPTIMIZE_SPEED
@@ -101,9 +99,8 @@ This package contains the OpenSSL command-line utility.
 endef
 
 
-OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-camellia no-krb5 
\
- no-whrlpool no-whirlpool no-seed no-jpake
-OPENSSL_OPTIONS:= shared no-err no-sse2 no-ssl2 no-ssl2-method no-heartbeats
+OPENSSL_NO_CIPHERS:= no-idea no-mdc2 no-camellia no-whirlpool no-seed
+OPENSSL_OPTIONS:= shared no-err no-heartbeats
 
 ifdef CONFIG_OPENSSL_ENGINE_CRYPTO
   OPENSSL_OPTIONS += -DHAVE_CRYPTODEV
@@ -111,7 +108,7 @@ ifdef CONFIG_OPENSSL_ENGINE_CRYPTO
 OPENSSL_OPTIONS += -DUSE_CRYPTODEV_DIGESTS
   endif
 else
-  OPENSSL_OPTIONS += no-engines
+  OPENSSL_OPTIONS += no-engine
 endif
 
 ifndef CONFIG_OPENSSL_WITH_EC
@@ -122,10 +119,6 @@ ifndef CONFIG_OPENSSL_WITH_EC2M
   OPENSSL_OPTIONS += no-ec2m
 endif
 
-ifndef CONFIG_OPENSSL_WITH_SSL3
-  OPENSSL_OPTIONS += no-ssl3 no-ssl3-method
-endif
-
 ifndef CONFIG_OPENSSL_HARDWARE_SUPPORT
   OPENSSL_OPTIONS += no-hw
 endif
@@ -144,10 +137,6 @@ else
   OPENSSL_OPTIONS += no-comp
 endif
 
-ifndef CONFIG_OPENSSL_WITH_NPN
-  OPENSSL_OPTIONS += no-nextp

[OpenWrt-Devel] [PATCH 2/4] libevent2: Make it build using OpenSSL 1.1.0

2018-05-22 Thread Eneas U de Queiroz via openwrt-devel
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
This is a backport of @kroeckx patch that was merged in
libevent release-2.1.7-rc.

Signed-off-by: Eneas U de Queiroz 
---
 .../0001-Make-it-build-using-OpenSSL-1.1.0.patch   | 202 +
 1 file changed, 202 insertions(+)
 create mode 100644 
package/libs/libevent2/patches/0001-Make-it-build-using-OpenSSL-1.1.0.patch

diff --git 
a/package/libs/libevent2/patches/0001-Make-it-build-using-OpenSSL-1.1.0.patch 
b/package/libs/libevent2/patches/0001-Make-it-build-using-OpenSSL-1.1.0.patch
new file mode 100644
index 00..fb9ad06eb6
--- /dev/null
+++ 
b/package/libs/libevent2/patches/0001-Make-it-build-using-OpenSSL-1.1.0.patch
@@ -0,0 +1,202 @@
+From 9982da6a9ed9156172bb09e18c54cd94e5ceb9a4 Mon Sep 17 00:00:00 2001
+From: Eneas U de Queiroz 
+Date: Mon, 21 May 2018 10:23:52 -0300
+Subject: [PATCH] Make it build using OpenSSL 1.1.0
+
+This is a backport of @kroeckx patch that was merged in
+release-2.1.7-rc:
+
+Rebased (azat):
+- tabs instead of whitespaces
+- make openssl-compat.h safe for complex expressions
+- do not call sk_SSL_COMP_free() in 1.1 (fixes double free)
+
+Signed-off-by: Eneas U de Queiroz 
+---
+ bufferevent_openssl.c | 62 +--
+ openssl-compat.h  | 33 +++
+ 2 files changed, 63 insertions(+), 32 deletions(-)
+ create mode 100644 openssl-compat.h
+
+diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c
+index 7582d9b4..5b177f0b 100644
+--- a/bufferevent_openssl.c
 b/bufferevent_openssl.c
+@@ -60,6 +60,7 @@
+ #include 
+ #include 
+ #include 
++#include "openssl-compat.h"
+ 
+ /*
+  * Define an OpenSSL bio that targets a bufferevent.
+@@ -103,10 +104,8 @@ print_err(int val)
+ static int
+ bio_bufferevent_new(BIO *b)
+ {
+-  b->init = 0;
+-  b->num = -1;
+-  b->ptr = NULL; /* We'll be putting the bufferevent in this field.*/
+-  b->flags = 0;
++  BIO_set_init(b, 0);
++  BIO_set_data(b, NULL); /* We'll be putting the bufferevent in this 
field.*/
+   return 1;
+ }
+ 
+@@ -116,12 +115,10 @@ bio_bufferevent_free(BIO *b)
+ {
+   if (!b)
+   return 0;
+-  if (b->shutdown) {
+-  if (b->init && b->ptr)
+-  bufferevent_free(b->ptr);
+-  b->init = 0;
+-  b->flags = 0;
+-  b->ptr = NULL;
++  if (BIO_get_shutdown(b)) {
++  if (BIO_get_init(b) && BIO_get_data(b))
++  bufferevent_free(BIO_get_data(b));
++  BIO_free(b);
+   }
+   return 1;
+ }
+@@ -137,10 +134,10 @@ bio_bufferevent_read(BIO *b, char *out, int outlen)
+ 
+   if (!out)
+   return 0;
+-  if (!b->ptr)
++  if (!BIO_get_data(b))
+   return -1;
+ 
+-  input = bufferevent_get_input(b->ptr);
++  input = bufferevent_get_input(BIO_get_data(b));
+   if (evbuffer_get_length(input) == 0) {
+   /* If there's no data to read, say so. */
+   BIO_set_retry_read(b);
+@@ -156,13 +153,13 @@ bio_bufferevent_read(BIO *b, char *out, int outlen)
+ static int
+ bio_bufferevent_write(BIO *b, const char *in, int inlen)
+ {
+-  struct bufferevent *bufev = b->ptr;
++  struct bufferevent *bufev = BIO_get_data(b);
+   struct evbuffer *output;
+   size_t outlen;
+ 
+   BIO_clear_retry_flags(b);
+ 
+-  if (!b->ptr)
++  if (!BIO_get_data(b))
+   return -1;
+ 
+   output = bufferevent_get_output(bufev);
+@@ -188,15 +185,15 @@ bio_bufferevent_write(BIO *b, const char *in, int inlen)
+ static long
+ bio_bufferevent_ctrl(BIO *b, int cmd, long num, void *ptr)
+ {
+-  struct bufferevent *bufev = b->ptr;
++  struct bufferevent *bufev = BIO_get_data(b);
+   long ret = 1;
+ 
+   switch (cmd) {
+   case BIO_CTRL_GET_CLOSE:
+-  ret = b->shutdown;
++  ret = BIO_get_shutdown(b);
+   break;
+   case BIO_CTRL_SET_CLOSE:
+-  b->shutdown = (int)num;
++  BIO_set_shutdown(b, (int)num);
+   break;
+   case BIO_CTRL_PENDING:
+   ret = evbuffer_get_length(bufferevent_get_input(bufev)) != 0;
+@@ -225,23 +222,24 @@ bio_bufferevent_puts(BIO *b, const char *s)
+ }
+ 
+ /* Method table for the bufferevent BIO */
+-static BIO_METHOD methods_bufferevent = {
+-  BIO_TYPE_LIBEVENT, "bufferevent",
+-  bio_bufferevent_write,
+-  bio_bufferevent_read,
+-  bio_bufferevent_puts,
+-  NULL /* bio_bufferevent_gets */,
+-  bio_bufferevent_ctrl,
+-  bio_bufferevent_new,
+-  bio_bufferevent_free,
+-  NULL /* callback_ctrl */,
+-};
++static BIO_METHOD *methods_bufferevent;
+ 
+ /* Return the method table for the b

[OpenWrt-Devel] 18.06 Bug: Baby Jumbo Frames on mt7621

2018-05-22 Thread Jaap Buurman
Dear all,

The switch to the 4.14 kernel apparently broke the baby jumbo frames
support of 2048 bytes that the switch is capable off. I found out that
changing the mtu above 1500 via Luci no longer applies properly.
Trying to manually change the mtu via ssh also fails:

root@LEDE:~# ifconfig eth0 mtu 1508 up
ifconfig: SIOCSIFMTU: Invalid argument

If there is any additional information that I can supply, please let
me know. I am also more than willing to help test potential fixes :)

Yours sincerely,

Jaap Buurman

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Bug: HW Flow Offload + Wireguard Bug

2018-05-22 Thread Jaap Buurman
Dear Felix & others,

I am currently running a 18.06 snapshot image to start testing the
stability of the firmware and new features, including the lovely
hardware flow offload. While it is working extremely well (I am
finally able to max out my connection, but with hardly any CPU load!),
pushing data through Wireguard instantly crashes my router whenever hw
flow offload is enabled. There is another report of this issue on the
forum, including a call trace:
https://forum.lede-project.org/t/netfilter-flow-offload-hw-nat/10237/44?u=mushoz

If you need any additional information or require my help testing,
please do not hesitate to contact me.

Yours sincerely,

Jaap Buurman

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Why nftables does not work in OpenWrt ?

2018-05-22 Thread Rosysong
Hi Hauke,
Do you mean my nftables commands (limit rate xxx) can work on your 
lantiq (4.14 kernel)  target ?
I also choose kmod-nf-flow and kmod-nft-offload modules, but it can 
not restrict the traffic flow on specific ip address yet.

>On 05/20/2018 12:25 PM, Rosysong wrote:

>> I am using mips(ramips) target.
>> 
>> 
>I tested this with lantiq and with kernel 4.9 nftables was working like
>expected and with kernel 4.14 it does not work any more.
>I do not know if this is caused by the more recent kernel or the flow
>offloading.

>Hauke
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel