[LEDE-DEV] [PATCH netifd] interface: fix "ifup-failed" hotplug event handling

2018-04-09 Thread Martin Schiller
The ifup-failed event should only be triggered when the former
interface state is IFS_SETUP.

Otherwise, there will also be an ifup-failed event in the
IFS_TEARDOWN stateif you do an manual ifdown .

Signed-off-by: Martin Schiller <m...@dev.tdt.de>
---
 interface.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/interface.c b/interface.c
index 900a523..2a23984 100644
--- a/interface.c
+++ b/interface.c
@@ -267,10 +267,16 @@ mark_interface_down(struct interface *iface)
 
iface->link_up_event = false;
iface->state = IFS_DOWN;
-   if (state == IFS_UP)
+   switch (state) {
+   case IFS_UP:
interface_event(iface, IFEV_DOWN);
-   else
+   break;
+   case IFS_SETUP:
interface_event(iface, IFEV_UP_FAILED);
+   break;
+   default:
+   break;
+   }
interface_ip_set_enabled(>config_ip, false);
interface_ip_set_enabled(>proto_ip, false);
interface_ip_flush(>proto_ip);
-- 
2.11.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH netifd] system-linux: add support for hotplug event 'move'

2017-09-29 Thread Martin Schiller

On 2017-09-29 00:36, Philip Prindeville wrote:

Inline…



On Sep 28, 2017, at 2:32 AM, Martin Schiller <m...@dev.tdt.de> wrote:

If you rename a network interface, there is a move uevent
invoked instead of remove/add.

This patch adds support for this kind of event.

Signed-off-by: Martin Schiller <m...@dev.tdt.de>
---
system-linux.c | 31 ---
1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/system-linux.c b/system-linux.c
index 6d97a02..e2017d0 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -543,16 +543,20 @@ out:
static void
handle_hotplug_msg(char *data, int size)
{
-   const char *subsystem = NULL, *interface = NULL;
+	const char *subsystem = NULL, *interface = NULL, *interface_old = 
NULL;

char *cur, *end, *sep;
struct device *dev;
int skip;
-   bool add;
+   bool add, move = false;

if (!strncmp(data, "add@", 4))
add = true;
else if (!strncmp(data, "remove@", 7))
add = false;
+   else if (!strncmp(data, "move@", 5)) {
+   add = true;
+   move = true;
+   }
else
return;

@@ -574,11 +578,32 @@ handle_hotplug_msg(char *data, int size)
if (strcmp(subsystem, "net") != 0)
return;
}
-   if (subsystem && interface)
+   else if (!strcmp(cur, "DEVPATH_OLD")) {
+   interface_old = strrchr(sep + 1, '/');
+   if (interface_old)
+   interface_old++;
+   }
+   }
+
+   if (subsystem && interface) {
+   if (move && interface_old)
+   goto move;
+   else
goto found;
}
+
return;

+move:
+   dev = device_find(interface_old);
+   if (!dev)
+   goto found;
+
+   if (dev->type != _device_type)
+   goto found;
+
+   device_set_present(dev, false);
+
found:
dev = device_find(interface);
if (!dev)




I’m a little unclear about how all of this would work.

We have a platform where the kernel always detects certain devices
(mostly i210 and i350 Intel NICs) in the wrong order, so early on
(S19) we run an init.d script which looks at their PCI bus information
and then depending on whether it matches the pattern of the devices
which get mis-numbered, we do the following:

ip link set eth0 name _eth0
ip link set eth1 name _eth1
...
ip link set eth7 name _eth7

ip link set _eth7 name eth0
ip link set _eth6 name eth1
...
ip link set _eth0 name eth7

so it seems to me that your logic would get confused by the “old”
instance of “eth0” and the new one.

Am I missing anything?


I can't see any reason why the logic would get confused here:

After the "ip link set eth0 name _eth0", the eth0 device would be set to 
"NOT-present".
And after "ip link set _eth7 name eth0", the eth0 device would be set to 
"present" again.


Martin.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH netifd] system-linux: add support for hotplug event 'move'

2017-09-28 Thread Martin Schiller
If you rename a network interface, there is a move uevent
invoked instead of remove/add.

This patch adds support for this kind of event.

Signed-off-by: Martin Schiller <m...@dev.tdt.de>
---
 system-linux.c | 31 ---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/system-linux.c b/system-linux.c
index 6d97a02..e2017d0 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -543,16 +543,20 @@ out:
 static void
 handle_hotplug_msg(char *data, int size)
 {
-   const char *subsystem = NULL, *interface = NULL;
+   const char *subsystem = NULL, *interface = NULL, *interface_old = NULL;
char *cur, *end, *sep;
struct device *dev;
int skip;
-   bool add;
+   bool add, move = false;
 
if (!strncmp(data, "add@", 4))
add = true;
else if (!strncmp(data, "remove@", 7))
add = false;
+   else if (!strncmp(data, "move@", 5)) {
+   add = true;
+   move = true;
+   }
else
return;
 
@@ -574,11 +578,32 @@ handle_hotplug_msg(char *data, int size)
if (strcmp(subsystem, "net") != 0)
return;
}
-   if (subsystem && interface)
+   else if (!strcmp(cur, "DEVPATH_OLD")) {
+   interface_old = strrchr(sep + 1, '/');
+   if (interface_old)
+   interface_old++;
+   }
+   }
+
+   if (subsystem && interface) {
+   if (move && interface_old)
+   goto move;
+   else
goto found;
}
+
return;
 
+move:
+   dev = device_find(interface_old);
+   if (!dev)
+   goto found;
+
+   if (dev->type != _device_type)
+   goto found;
+
+   device_set_present(dev, false);
+
 found:
dev = device_find(interface);
if (!dev)
-- 
2.11.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH netifd] interface: add new "ifup-failed" hotplug event

2017-05-07 Thread Martin Schiller

On 2017-05-06 14:47, Jo-Philipp Wich wrote:

Hi,


Are there any comments about this patch?


can't you achieve the same by simply watching ifdown events and 
checking

ifstatus/devstatus indicators?


No, unfortunately not. An ifdown event is only generated when the 
interface has already been up:


https://git.lede-project.org/?p=project/netifd.git;a=blob;f=interface.c;h=593b0490c85d8cc30dd338979aaea6b560e50866;hb=HEAD#l269

So, in a situation where a interface can't be established (e.g. wrong 
username/password) there won't be any event.



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH netifd] interface: add new "ifup-failed" hotplug event

2017-05-05 Thread Martin Schiller

Are there any comments about this patch?
I still want to get this feature into netifd.

On 2017-03-31 08:31, Martin Schiller wrote:

This hook makes it possible to do some helper work in hotplug scripts
when a connection is not established successfully.

example: try several username/passwords from a pool to establish a
pppoe or wwan connection by replacing the configured values of the
connection in a hotplug script.

Signed-off-by: Martin Schiller <m...@dev.tdt.de>
---
 interface-event.c | 2 ++
 interface.c   | 4 
 interface.h   | 1 +
 3 files changed, 7 insertions(+)

diff --git a/interface-event.c b/interface-event.c
index 4976c2c..86e8f54 100644
--- a/interface-event.c
+++ b/interface-event.c
@@ -33,6 +33,7 @@ static struct uloop_process task = {
 static const char * const eventnames[] = {
[IFEV_DOWN] = "ifdown",
[IFEV_UP] = "ifup",
+   [IFEV_UP_FAILED] = "ifup-failed",
[IFEV_UPDATE] = "ifupdate",
[IFEV_FREE] = "free",
[IFEV_RELOAD] = "reload",
@@ -191,6 +192,7 @@ static void interface_event_cb(struct
interface_user *dep, struct interface *ifa
switch (ev) {
case IFEV_LINK_UP:
case IFEV_UP:
+   case IFEV_UP_FAILED:
case IFEV_UPDATE:
case IFEV_DOWN:
interface_queue_event(iface, ev);
diff --git a/interface.c b/interface.c
index f150f7d..e04d477 100644
--- a/interface.c
+++ b/interface.c
@@ -241,6 +241,7 @@ interface_event(struct interface *iface, enum
interface_event ev)
adev = iface->l3_dev.dev;
/* fall through */
case IFEV_DOWN:
+   case IFEV_UP_FAILED:
alias_notify_device(iface->name, adev);
break;
default:
@@ -268,6 +269,8 @@ mark_interface_down(struct interface *iface)
iface->state = IFS_DOWN;
if (state == IFS_UP)
interface_event(iface, IFEV_DOWN);
+   else
+   interface_event(iface, IFEV_UP_FAILED);
interface_ip_set_enabled(>config_ip, false);
interface_ip_set_enabled(>proto_ip, false);
interface_ip_flush(>proto_ip);
@@ -557,6 +560,7 @@ interface_alias_cb(struct interface_user *dep,
struct interface *iface, enum int
interface_set_available(alias, true);
break;
case IFEV_DOWN:
+   case IFEV_UP_FAILED:
interface_set_available(alias, false);
interface_set_main_dev(alias, NULL);
break;
diff --git a/interface.h b/interface.h
index 1472324..c51705c 100644
--- a/interface.h
+++ b/interface.h
@@ -23,6 +23,7 @@ struct interface_proto_state;
 enum interface_event {
IFEV_DOWN,
IFEV_UP,
+   IFEV_UP_FAILED,
IFEV_UPDATE,
IFEV_FREE,
IFEV_RELOAD,



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH netifd] interface: add new "ifup-failed" hotplug event

2017-03-31 Thread Martin Schiller
This hook makes it possible to do some helper work in hotplug scripts
when a connection is not established successfully.

example: try several username/passwords from a pool to establish a
pppoe or wwan connection by replacing the configured values of the
connection in a hotplug script.

Signed-off-by: Martin Schiller <m...@dev.tdt.de>
---
 interface-event.c | 2 ++
 interface.c   | 4 
 interface.h   | 1 +
 3 files changed, 7 insertions(+)

diff --git a/interface-event.c b/interface-event.c
index 4976c2c..86e8f54 100644
--- a/interface-event.c
+++ b/interface-event.c
@@ -33,6 +33,7 @@ static struct uloop_process task = {
 static const char * const eventnames[] = {
[IFEV_DOWN] = "ifdown",
[IFEV_UP] = "ifup",
+   [IFEV_UP_FAILED] = "ifup-failed",
[IFEV_UPDATE] = "ifupdate",
[IFEV_FREE] = "free",
[IFEV_RELOAD] = "reload",
@@ -191,6 +192,7 @@ static void interface_event_cb(struct interface_user *dep, 
struct interface *ifa
switch (ev) {
case IFEV_LINK_UP:
case IFEV_UP:
+   case IFEV_UP_FAILED:
case IFEV_UPDATE:
case IFEV_DOWN:
interface_queue_event(iface, ev);
diff --git a/interface.c b/interface.c
index f150f7d..e04d477 100644
--- a/interface.c
+++ b/interface.c
@@ -241,6 +241,7 @@ interface_event(struct interface *iface, enum 
interface_event ev)
adev = iface->l3_dev.dev;
/* fall through */
case IFEV_DOWN:
+   case IFEV_UP_FAILED:
alias_notify_device(iface->name, adev);
break;
default:
@@ -268,6 +269,8 @@ mark_interface_down(struct interface *iface)
iface->state = IFS_DOWN;
if (state == IFS_UP)
interface_event(iface, IFEV_DOWN);
+   else
+   interface_event(iface, IFEV_UP_FAILED);
interface_ip_set_enabled(>config_ip, false);
interface_ip_set_enabled(>proto_ip, false);
interface_ip_flush(>proto_ip);
@@ -557,6 +560,7 @@ interface_alias_cb(struct interface_user *dep, struct 
interface *iface, enum int
interface_set_available(alias, true);
break;
case IFEV_DOWN:
+   case IFEV_UP_FAILED:
interface_set_available(alias, false);
interface_set_main_dev(alias, NULL);
break;
diff --git a/interface.h b/interface.h
index 1472324..c51705c 100644
--- a/interface.h
+++ b/interface.h
@@ -23,6 +23,7 @@ struct interface_proto_state;
 enum interface_event {
IFEV_DOWN,
IFEV_UP,
+   IFEV_UP_FAILED,
IFEV_UPDATE,
IFEV_FREE,
IFEV_RELOAD,
-- 
2.1.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2] libpcap: add optional netfilter support

2017-02-19 Thread Martin Schiller
This is needed to use the nflog interface with tcpdump

Signed-off-by: Martin Schiller <mschil...@tdt.de>
---
 package/libs/libpcap/Config.in | 4 
 package/libs/libpcap/Makefile  | 7 +--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/package/libs/libpcap/Config.in b/package/libs/libpcap/Config.in
index 05f45f4..1159927 100644
--- a/package/libs/libpcap/Config.in
+++ b/package/libs/libpcap/Config.in
@@ -10,4 +10,8 @@ config PCAP_HAS_BT
depends on BROKEN
default n
 
+config PCAP_HAS_NETFILTER
+   bool "Include netfilter support"
+   default n
+
 endmenu
diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile
index d3360d2..4d0ce40 100644
--- a/package/libs/libpcap/Makefile
+++ b/package/libs/libpcap/Makefile
@@ -48,9 +48,12 @@ TARGET_CFLAGS += \
 
 CONFIGURE_VARS += \
ac_cv_linux_vers=$(LINUX_VERSION) \
-   ac_cv_header_libusb_1_0_libusb_h=no \
-   ac_cv_netfilter_can_compile=no
+   ac_cv_header_libusb_1_0_libusb_h=no
 
+ifeq ($(CONFIG_PCAP_HAS_NETFILTER),)
+CONFIGURE_VARS += \
+   ac_cv_netfilter_can_compile=no
+endif
 
 CONFIGURE_ARGS += \
--enable-shared \
-- 
2.1.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] libpcap: add optional netfilter support

2017-02-16 Thread Martin Schiller
This is needed to use the nflog interface with tcpdump

Signed-off-by: Martin Schiller <mschil...@tdt.de>
---
 package/libs/libpcap/Config.in | 5 +
 package/libs/libpcap/Makefile  | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/package/libs/libpcap/Config.in b/package/libs/libpcap/Config.in
index 5fee75a..764d471 100644
--- a/package/libs/libpcap/Config.in
+++ b/package/libs/libpcap/Config.in
@@ -12,4 +12,9 @@ config PCAP_HAS_BT
depends on BROKEN
default n
 
+config PCAP_HAS_NETFILTER
+   bool "Include netfilter support"
+   select PACKAGE_kmod-ipt-nflog
+   default n
+
 endmenu
diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile
index d3360d2..4d0ce40 100644
--- a/package/libs/libpcap/Makefile
+++ b/package/libs/libpcap/Makefile
@@ -48,9 +48,12 @@ TARGET_CFLAGS += \
 
 CONFIGURE_VARS += \
ac_cv_linux_vers=$(LINUX_VERSION) \
-   ac_cv_header_libusb_1_0_libusb_h=no \
-   ac_cv_netfilter_can_compile=no
+   ac_cv_header_libusb_1_0_libusb_h=no
 
+ifeq ($(CONFIG_PCAP_HAS_NETFILTER),)
+CONFIGURE_VARS += \
+   ac_cv_netfilter_can_compile=no
+endif
 
 CONFIGURE_ARGS += \
--enable-shared \
-- 
2.1.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 2/3] ltq-deu: fix handling of data blocks with sizes != AES/DES block size

2016-08-18 Thread Martin Schiller
This fix is a backport from the lantiq UGW-6.1.1-MR1

Signed-off-by: Martin Schiller <mschil...@tdt.de>
---
 package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c | 124 ++--
 package/kernel/lantiq/ltq-deu/src/ifxmips_des.c |  28 +++---
 2 files changed, 108 insertions(+), 44 deletions(-)

diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c 
b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
index fe888b8..9ef42d1 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
@@ -249,6 +249,26 @@ void ifx_deu_aes (void *ctx_arg, u8 *out_arg, const u8 
*in_arg,
 byte_cnt -= 16;
 }
 
+/* To handle all non-aligned bytes (not aligned to 16B size) */
+if (byte_cnt) {
+aes->ID3R = INPUT_ENDIAN_SWAP(*((u32 *) in_arg + (i * 4) + 0));
+aes->ID2R = INPUT_ENDIAN_SWAP(*((u32 *) in_arg + (i * 4) + 1));
+aes->ID1R = INPUT_ENDIAN_SWAP(*((u32 *) in_arg + (i * 4) + 2));
+aes->ID0R = INPUT_ENDIAN_SWAP(*((u32 *) in_arg + (i * 4) + 3));/* 
start crypto */
+
+while (aes->controlr.BUS) {
+}
+
+*((volatile u32 *) out_arg + (i * 4) + 0) = aes->OD3R;
+*((volatile u32 *) out_arg + (i * 4) + 1) = aes->OD2R;
+*((volatile u32 *) out_arg + (i * 4) + 2) = aes->OD1R;
+*((volatile u32 *) out_arg + (i * 4) + 3) = aes->OD0R;
+
+/* to ensure that the extended pages are clean */
+memset (out_arg + (i * 16) + (nbytes % AES_BLOCK_SIZE), 0,
+(AES_BLOCK_SIZE - (nbytes % AES_BLOCK_SIZE)));
+
+}
 
 //tc.chen : copy iv_arg back
 if (mode > 0) {
@@ -467,14 +487,15 @@ int ecb_aes_encrypt(struct blkcipher_desc *desc,
 struct aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
 struct blkcipher_walk walk;
 int err;
+unsigned int enc_bytes;
 
 blkcipher_walk_init(, dst, src, nbytes);
 err = blkcipher_walk_virt(desc, );
 
-while ((nbytes = walk.nbytes)) {
-nbytes -= (nbytes % AES_BLOCK_SIZE); 
+while ((nbytes = enc_bytes = walk.nbytes)) {
+enc_bytes -= (nbytes % AES_BLOCK_SIZE);
 ifx_deu_aes_ecb(ctx, walk.dst.virt.addr, walk.src.virt.addr, 
-   NULL, nbytes, CRYPTO_DIR_ENCRYPT, 0);
+   NULL, enc_bytes, CRYPTO_DIR_ENCRYPT, 0);
 nbytes &= AES_BLOCK_SIZE - 1;
 err = blkcipher_walk_done(desc, , nbytes);
 }
@@ -498,14 +519,15 @@ int ecb_aes_decrypt(struct blkcipher_desc *desc,
 struct aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
 struct blkcipher_walk walk;
 int err;
+unsigned int dec_bytes;
 
 blkcipher_walk_init(, dst, src, nbytes);
 err = blkcipher_walk_virt(desc, );
 
-while ((nbytes = walk.nbytes)) {
-nbytes -= (nbytes % AES_BLOCK_SIZE); 
+while ((nbytes = dec_bytes = walk.nbytes)) {
+dec_bytes -= (nbytes % AES_BLOCK_SIZE);
 ifx_deu_aes_ecb(ctx, walk.dst.virt.addr, walk.src.virt.addr, 
-   NULL, nbytes, CRYPTO_DIR_DECRYPT, 0);
+   NULL, dec_bytes, CRYPTO_DIR_DECRYPT, 0);
 nbytes &= AES_BLOCK_SIZE - 1;
 err = blkcipher_walk_done(desc, , nbytes);
 }
@@ -553,15 +575,16 @@ int cbc_aes_encrypt(struct blkcipher_desc *desc,
 struct aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
 struct blkcipher_walk walk;
 int err;
+unsigned int enc_bytes;
 
 blkcipher_walk_init(, dst, src, nbytes);
 err = blkcipher_walk_virt(desc, );
 
-while ((nbytes = walk.nbytes)) {
+while ((nbytes = enc_bytes = walk.nbytes)) {
 u8 *iv = walk.iv;
-nbytes -= (nbytes % AES_BLOCK_SIZE);
+enc_bytes -= (nbytes % AES_BLOCK_SIZE);
 ifx_deu_aes_cbc(ctx, walk.dst.virt.addr, walk.src.virt.addr, 
-   iv, nbytes, CRYPTO_DIR_ENCRYPT, 0);  
+   iv, enc_bytes, CRYPTO_DIR_ENCRYPT, 0);
 nbytes &= AES_BLOCK_SIZE - 1;
 err = blkcipher_walk_done(desc, , nbytes);
 }
@@ -585,15 +608,16 @@ int cbc_aes_decrypt(struct blkcipher_desc *desc,
 struct aes_ctx *ctx = crypto_blkcipher_ctx(desc->tfm);
 struct blkcipher_walk walk;
 int err;
+unsigned int dec_bytes;
 
 blkcipher_walk_init(, dst, src, nbytes);
 err = blkcipher_walk_virt(desc, );
 
-while ((nbytes = walk.nbytes)) {
+while ((nbytes = dec_bytes = walk.nbytes)) {
 u8 *iv = walk.iv;
-nbytes -= (nbytes % AES_BLOCK_SIZE);
+dec_bytes -= (nbytes % AES_BLOCK_SIZE);
 ifx_deu_aes_cbc(ctx, walk.dst.virt.addr, walk.src.virt.addr, 
-   iv, nbytes, CRYPTO_DIR_DECRYPT, 0);
+   iv, dec_bytes, CRYPTO_DIR_DECRYPT, 0);
 nbytes &= AES_BLOCK_SIZE - 1;
 err = blkcipher_walk_done(desc, , nbytes);
 }
@@ -642,15 +666,16 @@ int ctr_basic_a

[LEDE-DEV] [PATCH 3/3] ltq-deu: fix cra_priority

2016-08-18 Thread Martin Schiller
With the default priority of 0, the DEU algos would be overlapped
by the generic algos (if available).

To fix this, set the cra_priority of the hardware algos to the
recommended value of 300/400.

Signed-off-by: Martin Schiller <mschil...@tdt.de>
---
 package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c   | 5 +
 package/kernel/lantiq/ltq-deu/src/ifxmips_arc4.c  | 2 ++
 package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c | 8 
 package/kernel/lantiq/ltq-deu/src/ifxmips_async_des.c | 8 
 package/kernel/lantiq/ltq-deu/src/ifxmips_des.c   | 6 ++
 package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c   | 1 +
 package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c  | 1 +
 package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c  | 1 +
 package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c | 1 +
 9 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c 
b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
index 9ef42d1..b51cf47 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_aes.c
@@ -455,6 +455,7 @@ void aes_decrypt (struct crypto_tfm *tfm, uint8_t *out, 
const uint8_t *in)
 struct crypto_alg ifxdeu_aes_alg = {
 .cra_name   =   "aes",
 .cra_driver_name=   "ifxdeu-aes",
+.cra_priority   =   300,
 .cra_flags  =   CRYPTO_ALG_TYPE_CIPHER,
 .cra_blocksize  =   AES_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct aes_ctx),
@@ -541,6 +542,7 @@ int ecb_aes_decrypt(struct blkcipher_desc *desc,
 struct crypto_alg ifxdeu_ecb_aes_alg = {
 .cra_name   =   "ecb(aes)",
 .cra_driver_name=   "ifxdeu-ecb(aes)",
+.cra_priority   =   400,
 .cra_flags  =   CRYPTO_ALG_TYPE_BLKCIPHER,
 .cra_blocksize  =   AES_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct aes_ctx),
@@ -631,6 +633,7 @@ int cbc_aes_decrypt(struct blkcipher_desc *desc,
 struct crypto_alg ifxdeu_cbc_aes_alg = {
 .cra_name   =   "cbc(aes)",
 .cra_driver_name=   "ifxdeu-cbc(aes)",
+.cra_priority   =   400,
 .cra_flags  =   CRYPTO_ALG_TYPE_BLKCIPHER,
 .cra_blocksize  =   AES_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct aes_ctx),
@@ -722,6 +725,7 @@ int ctr_basic_aes_decrypt(struct blkcipher_desc *desc,
 struct crypto_alg ifxdeu_ctr_basic_aes_alg = {
 .cra_name   =   "ctr(aes)",
 .cra_driver_name=   "ifxdeu-ctr(aes)",
+.cra_priority   =   400,
 .cra_flags  =   CRYPTO_ALG_TYPE_BLKCIPHER,
 .cra_blocksize  =   AES_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct aes_ctx),
@@ -861,6 +865,7 @@ int ctr_rfc3686_aes_decrypt(struct blkcipher_desc *desc,
 struct crypto_alg ifxdeu_ctr_rfc3686_aes_alg = {
 .cra_name  =   "rfc3686(ctr(aes))",
 .cra_driver_name=   "ifxdeu-ctr-rfc3686(aes)",
+.cra_priority   =   400,
 .cra_flags =   CRYPTO_ALG_TYPE_BLKCIPHER,
 .cra_blocksize  =   AES_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct aes_ctx),
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_arc4.c 
b/package/kernel/lantiq/ltq-deu/src/ifxmips_arc4.c
index ee56187..d0818dd 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_arc4.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_arc4.c
@@ -242,6 +242,7 @@ static void arc4_crypt(struct crypto_tfm *tfm, u8 *out, 
const u8 *in)
 static struct crypto_alg ifxdeu_arc4_alg = {
 .cra_name   =   "arc4",
 .cra_driver_name=   "ifxdeu-arc4",
+.cra_priority   =   300,
 .cra_flags  =   CRYPTO_ALG_TYPE_CIPHER,
 .cra_blocksize  =   ARC4_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct arc4_ctx),
@@ -324,6 +325,7 @@ static int ecb_arc4_decrypt(struct blkcipher_desc *desc,
 static struct crypto_alg ifxdeu_ecb_arc4_alg = {
 .cra_name   =   "ecb(arc4)",
 .cra_driver_name=   "ifxdeu-ecb(arc4)",
+.cra_priority   =   400,
 .cra_flags  =   CRYPTO_ALG_TYPE_BLKCIPHER,
 .cra_blocksize  =   ARC4_BLOCK_SIZE,
 .cra_ctxsize=   sizeof(struct arc4_ctx),
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c 
b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
index 64536da..15e1485 100644
--- a/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
+++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_async_aes.c
@@ -992,7 +992,7 @@ static struct lq_aes_alg aes_drivers_alg[] = {
.cra_blocksize   = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct aes_ctx),
.cra_type= _ablkcipher_type,
-   .cra_priority= 300,
+   .cra_priority= 400,
   

[LEDE-DEV] [PATCH] lantiq/xrx200-net: Add support for eth0 as WAN interface

2016-08-15 Thread Martin Schiller
Use priv->wan instead of priv->id as indicator if packets should go to the
Ethernet WAN group (DPID=1) or not (DPID=0). This way, it's independant of
interface names or indexes.

Signed-off-by: Martin Schiller <mschil...@tdt.de>
---
 .../linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch 
b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index c01ab33..4e60f30 100644
--- a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
+++ b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
@@ -1297,7 +1297,7 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +  special_tag |= port_map << PORT_MAP_SHIFT;
 +  }
 +  special_tag |= priv->port_map << PORT_MAP_SHIFT;
-+  if(priv->id)
++  if(priv->wan)
 +  special_tag |= (1 << DPID_SHIFT);
 +  if(skb_headroom(skb) < 4) {
 +  struct sk_buff *tmp = skb_realloc_headroom(skb, 4);
-- 
2.1.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev