[PATCH iproute2] ip fou: Pass family attribute as u8

2018-01-07 Thread Filip Moc
This fixes fou on big-endian systems.

Signed-off-by: Filip Moc 
---
 ip/ipfou.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/ipfou.c b/ip/ipfou.c
index febc2c8c..1f392ade 100644
--- a/ip/ipfou.c
+++ b/ip/ipfou.c
@@ -52,7 +52,7 @@ static int fou_parse_opt(int argc, char **argv, struct 
nlmsghdr *n,
__u8 ipproto, type;
bool gue_set = false;
int ipproto_set = 0;
-   unsigned short family = AF_INET;
+   __u8 family = AF_INET;
 
while (argc > 0) {
if (!matches(*argv, "port")) {
@@ -103,7 +103,7 @@ static int fou_parse_opt(int argc, char **argv, struct 
nlmsghdr *n,
 
addattr16(n, 1024, FOU_ATTR_PORT, port);
addattr8(n, 1024, FOU_ATTR_TYPE, type);
-   addattr16(n, 1024, FOU_ATTR_AF, family);
+   addattr8(n, 1024, FOU_ATTR_AF, family);
 
if (ipproto_set)
addattr8(n, 1024, FOU_ATTR_IPPROTO, ipproto);
-- 
2.11.0



Re: [PATCH iproute2] ip fou: Pass family attribute as u8

2018-01-07 Thread Filip Moc
Hi Stephen,

> How is this binary compatiable with older versions.
I'm not sure what you mean. Kernel expects family attribute to be passed as u8
(and it always did). But current ip passes family attribute as u16. It works
now only on little endian systems because the relevant byte happens to be on
the same position. It is the current version of ip which is incompatible.

Filip



[PATCH] net: usb: qmi_wwan: Set DTR quirk for MR400

2020-11-17 Thread Filip Moc
LTE module MR400 embedded in TL-MR6400 v4 requires DTR to be set.

Signed-off-by: Filip Moc 
---
 drivers/net/usb/qmi_wwan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index afeb09b9624e..d166c321ee9b 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1047,7 +1047,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x05c6, 0x9011, 4)},
{QMI_FIXED_INTF(0x05c6, 0x9021, 1)},
{QMI_FIXED_INTF(0x05c6, 0x9022, 2)},
-   {QMI_FIXED_INTF(0x05c6, 0x9025, 4)},/* Alcatel-sbell ASB TL131 TDD 
LTE  (China Mobile) */
+   {QMI_QUIRK_SET_DTR(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD 
LTE (China Mobile) */
{QMI_FIXED_INTF(0x05c6, 0x9026, 3)},
{QMI_FIXED_INTF(0x05c6, 0x902e, 5)},
{QMI_FIXED_INTF(0x05c6, 0x9031, 5)},
-- 
2.28.0