[PATCH] geneve: fix tx_errors statistics

2016-06-21 Thread Haishuang Yan
Tx errors present summation of errors encountered while transmitting packets. Signed-off-by: Haishuang Yan --- drivers/net/geneve.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index aa61708..72b2f1c 100644 --- a/drivers

[PATCH 1/2] ip6_gre: Fix get_size calculation for gre6 tunnel

2016-05-11 Thread Haishuang Yan
Do not include attribute IFLA_GRE_TOS. Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index ee62ec4..3c25fe6 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -1394,8 +1394,6 @@ static

[PATCH 2/2] gre: Fix wrong tpi->proto in WCCP

2016-05-11 Thread Haishuang Yan
When dealing with WCCP in gre6 tunnel, it sets the wrong tpi->protocol, that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic. Signed-off-by: Haishuang Yan --- include/net/gre.h| 2 +- net/ipv4/gre_demux.c | 6 +++--- net/ipv4/ip_gre.c| 4 ++-- net/ipv6/ip6_gre.c

[PATCH v2 2/2] ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit path.

2016-05-21 Thread Haishuang Yan
In gre6 xmit path, we are sending a GRE packet, so set fl6 proto to IPPROTO_GRE properly. Signed-off-by: Haishuang Yan --- Changes in v2: - Initialize the flow protocol in ip6gre_tnl_link_config --- net/ipv6/ip6_gre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ip6_gre.c b

[PATCH v2 1/2] ip6_gre: Fix MTU setting for ip6gretap

2016-05-21 Thread Haishuang Yan
erify the dev->type is ARPHRD_ETHER for ip6gretap interface, and then decrease the mtu as early as possible. Signed-off-by: Haishuang Yan --- Changes in v2: - Make the commit message more clearer. --- net/ipv6/ip6_gre.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ip

[PATCH] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)

2016-05-22 Thread Haishuang Yan
For ipv6 case, enclose the code block in macro IS_ENABLED(CONFIG_IPV6). Signed-off-by: Haishuang Yan --- net/ipv4/ip_tunnel.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index a69ed94..5f3c8de 100644 --- a/net/ipv4

[PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)

2016-05-23 Thread Haishuang Yan
For ipv6 case, enclose the code block in macro IS_ENABLED(CONFIG_IPV6). --- Changes in v2: - Place the "#if IS_ENABLED" block before the "} else if (..) {" piece and the "#endif" before the closing brace and this becomes much easier to look at. Signed-off-by

[PATCH 2/2] ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit path.

2016-05-18 Thread Haishuang Yan
In gre6 xmit path, we are sending a GRE packet, so set fl6 proto to IPPROTO_GRE properly. Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 8ea5a4d..cc84098 100644 --- a/net/ipv6/ip6_gre.c

[PATCH 1/2] ip6_gre: Fix MTU setting for ip6gretap

2016-05-18 Thread Haishuang Yan
2001:0:130::2 remote 2001:0:130::1 ip link show ip6gretap1 12: ip6gretap1@NONE: mtu 1448 ... link/ether 7e:e1:d2:c4:06:5e brd ff:ff:ff:ff:ff:ff Now, the MTU value 1448 is larger than what was needed. This patch fix the issue in this situation. Signed-off-by: Haishuang Yan --- net/ipv6

[PATCH] veth: Fix potential memory leak in veth_newlink

2016-04-27 Thread Haishuang Yan
Free peer netdev when failed to configure peer link or register dev. Signed-off-by: Haishuang Yan --- drivers/net/veth.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index f37a6e6..8bb9fb8 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c

[PATCH] netlink: use nla_get_in_addr and nla_put_in_addr for ipv4 address

2016-03-31 Thread Haishuang Yan
Since nla_get_in_addr and nla_put_in_addr were implemented, so use them appropriately. Signed-off-by: Haishuang Yan --- net/ipv4/ip_tunnel_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index 02dd990

[PATCH] netfilter: unnecessary to check whether ip6_route_output() returns NULL

2016-04-03 Thread Haishuang Yan
ip6_route_output() never returns NULL, so it is not appropriate to check if the return value is NULL. Signed-off-by: Haishuang Yan --- net/ipv6/netfilter/nf_reject_ipv6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6

[PATCH 2/2] ipv6: l2tp: fix a potential issue in l2tp_ip6_recv

2016-04-03 Thread Haishuang Yan
pskb_may_pull() can change skb->data, so we have to load ptr/optr at the right place. Signed-off-by: Haishuang Yan --- net/l2tp/l2tp_ip6.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index 6b54ff3..cd47990 100644 --

[PATCH 1/2] ipv4: l2tp: fix a potential issue in l2tp_ip_recv

2016-04-03 Thread Haishuang Yan
pskb_may_pull() can change skb->data, so we have to load ptr/optr at the right place. Signed-off-by: Haishuang Yan --- net/l2tp/l2tp_ip.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index ec22078..42de4cc 100644 --- a/

[PATCH v3 1/3] selftests: netfilter: add ipvs test script

2019-10-01 Thread Haishuang Yan
Test virutal server via directing routing for IPv4. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v3: use bash style v2: optimize test script --- tools/testing/selftests/netfilter/Makefile | 2

[PATCH v3 2/3] selftests: netfilter: add ipvs nat test case

2019-10-01 Thread Haishuang Yan
Test virtual server via NAT. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # ipvs.sh: PASS Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 0/3] selftests: netfilter: introduce test cases for ipvs

2019-10-01 Thread Haishuang Yan
results: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Haishuang Yan (3): selftests: netfilter: add ipvs test script selftests: netfilter: add ipvs nat test case selftests: netfilter: add ipvs

[PATCH v3 3/3] selftests: netfilter: add ipvs tunnel test case

2019-10-01 Thread Haishuang Yan
Test virtual server via ipip tunnel. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v2: optimize test script --- tools/testing/selftests/netfilter

[PATCH] ip6erspan: remove the incorrect mtu limit for ip6erspan

2019-10-08 Thread Haishuang Yan
orrect for ip6erspan tap device. Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index d5779d6..787d9f2 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -2192,6 +2192,7 @@ s

[PATCH v5 3/3] selftests: netfilter: add ipvs tunnel test case

2019-10-09 Thread Haishuang Yan
Test virtual server via ipip tunnel. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v2: optimize test script --- tools/testing/selftests/netfilter

[PATCH v5 2/3] selftests: netfilter: add ipvs nat test case

2019-10-09 Thread Haishuang Yan
Test virtual server via NAT. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # ipvs.sh: PASS Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[PATCH v5 1/3] selftests: netfilter: add ipvs test script

2019-10-09 Thread Haishuang Yan
Test virutal server via directing routing for IPv4. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v5: use cmp to compare two file contents suggested by Simon Horman v4: use #!/bin/bash -p

[PATCH v5 0/3] selftests: netfilter: introduce test cases for ipvs

2019-10-09 Thread Haishuang Yan
results: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan Haishuang Yan (3): selftests: netfilter: add ipvs test script selftests: netfilter: add ipvs nat test case

Re: [PATCH v3 0/3] selftests: netfilter: introduce test cases for ipvs

2019-10-04 Thread Haishuang Yan
> On 2019年10月4日, at 下午7:47, Duncan Roe wrote: > > On Thu, Oct 03, 2019 at 10:41:06PM +0800, Haishuang Yan wrote: >> >> >>> On 2019??10??2??, at 9:27, Duncan Roe >>> wrote: >>> >>> On Tue, Oct 01, 2019 at 09:34:13PM +0300, Julia

[PATCH v4 0/3] selftests: netfilter: introduce test cases for ipvs

2019-10-05 Thread Haishuang Yan
results: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Haishuang Yan (3): selftests: netfilter: add ipvs test script selftests: netfilter: add ipvs nat test case selftests: netfilter: add ipvs

[PATCH v4 1/3] selftests: netfilter: add ipvs test script

2019-10-05 Thread Haishuang Yan
Test virutal server via directing routing for IPv4. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v4: use #!/bin/bash -p suggested by Duncan Roe v3: use bash style v2: optimize test script

[PATCH v4 3/3] selftests: netfilter: add ipvs tunnel test case

2019-10-05 Thread Haishuang Yan
Test virtual server via ipip tunnel. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v2: optimize test script --- tools/testing/selftests/netfilter

[PATCH v4 2/3] selftests: netfilter: add ipvs nat test case

2019-10-05 Thread Haishuang Yan
Test virtual server via NAT. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # ipvs.sh: PASS Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[PATCH 0/3] selftests: netfilter: introduce test cases for ipvs

2019-09-26 Thread Haishuang Yan
results: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Haishuang Yan (3): selftests: netfilter: add ipvs test script selftests: netfilter: add ipvs nat test case selftests: netfilter: add ipvs

[PATCH 1/3] selftests: netfilter: add ipvs test script

2019-09-26 Thread Haishuang Yan
Test virutal server via directing routing for IPv4. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/Makefile | 2 +- tools/testing/selftests/netfilter/ipvs.sh

[PATCH 3/3] selftests: netfilter: add ipvs tunnel test case

2019-09-26 Thread Haishuang Yan
Test virtual server via ipip tunnel. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 33

[PATCH 2/3] selftests: netfilter: add ipvs nat test case

2019-09-26 Thread Haishuang Yan
Test virtual server via NAT. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # ipvs.sh: PASS Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[PATCH v2 0/2] ipvs: speedup ipvs netns dismantle

2019-09-26 Thread Haishuang Yan
unables000 : slabdata670670 0 real0m7.623s user0m2.003s sys 0m32.935s Haishuang Yan (2): ipvs: batch __ip_vs_cleanup ipvs: batch __ip_vs_dev_cleanup include/net/ip_vs.h | 2 +- net/netfilter/ipvs/ip_vs_core

[PATCH v2 1/2] ipvs: batch __ip_vs_cleanup

2019-09-26 Thread Haishuang Yan
It's better to batch __ip_vs_cleanup to speedup ipvs connections dismantle. Signed-off-by: Haishuang Yan --- v2: remove unused pointer list --- include/net/ip_vs.h | 2 +- net/netfilter/ipvs/ip_vs_core.c | 28 net/netfilter/ipvs/ip_vs_ctl.c

[PATCH v2 2/2] ipvs: batch __ip_vs_dev_cleanup

2019-09-26 Thread Haishuang Yan
It's better to batch __ip_vs_cleanup to speedup ipvs devices dismantle. Signed-off-by: Haishuang Yan --- v2: remove unused pointer list --- net/netfilter/ipvs/ip_vs_core.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_cor

[PATCH v2 2/3] selftests: netfilter: add ipvs nat test case

2019-09-26 Thread Haishuang Yan
Test virtual server via NAT. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # ipvs.sh: PASS Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[PATCH v2 0/3] selftests: netfilter: introduce test cases for ipvs

2019-09-26 Thread Haishuang Yan
results: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Haishuang Yan (3): selftests: netfilter: add ipvs test script selftests: netfilter: add ipvs nat test case selftests: netfilter: add ipvs

[PATCH v2 3/3] selftests: netfilter: add ipvs tunnel test case

2019-09-26 Thread Haishuang Yan
Test virtual server via ipip tunnel. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v2: optimize test script --- tools/testing/selftests/netfilter

[PATCH v2 1/3] selftests: netfilter: add ipvs test script

2019-09-26 Thread Haishuang Yan
Test virutal server via directing routing for IPv4. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v2: optimize test script --- tools/testing/selftests/netfilter/Makefile | 2 +- tools/testing

[PATCH] erspan: remove the incorrect mtu limit for erspan

2019-09-26 Thread Haishuang Yan
0:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 0 Fixes: 61e84623ace3 ("net: centralize net_device min/max MTU checking") Signed-off-by: Haishuang Yan --- net/ipv4/ip_gre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index a53

Re: [net-next 1/2] ipvs: batch __ip_vs_cleanup

2019-07-18 Thread Haishuang Yan
> On 2019年7月16日, at 上午4:39, Julian Anastasov wrote: > > > Hello, > > On Sat, 13 Jul 2019, Haishuang Yan wrote: > >> It's better to batch __ip_vs_cleanup to speedup ipvs >> connections dismantle. >> >> Signed-off-by: Haishuang Y

[PATCH] openvswitch: Fix a possible memory leak on dst_cache

2019-07-18 Thread Haishuang Yan
dst_cache should be destroyed when fail to add flow actions. Fixes: d71785ffc7e7 ("net: add dst_cache to ovs vxlan lwtunnel") Signed-off-by: Haishuang Yan --- net/openvswitch/flow_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/openvswitch/flow_netlink.c b/net/o

[PATCH v6 1/3] selftests: netfilter: add ipvs test script

2019-10-10 Thread Haishuang Yan
Test virutal server via directing routing for IPv4. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v6: use #!/bin/sh v5: use cmp to compare two file contents suggested by Simon Horman v4: use

[PATCH v6 2/3] selftests: netfilter: add ipvs nat test case

2019-10-10 Thread Haishuang Yan
Test virtual server via NAT. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # ipvs.sh: PASS Signed-off-by: Haishuang Yan --- tools/testing/selftests/netfilter/ipvs.sh | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a

[PATCH v6 3/3] selftests: netfilter: add ipvs tunnel test case

2019-10-10 Thread Haishuang Yan
Test virtual server via ipip tunnel. Tested: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan --- v2: optimize test script --- tools/testing/selftests/netfilter

[PATCH v6 0/3] selftests: netfilter: introduce test cases for ipvs

2019-10-10 Thread Haishuang Yan
results: # selftests: netfilter: ipvs.sh # Testing DR mode... # Testing NAT mode... # Testing Tunnel mode... # ipvs.sh: PASS ok 6 selftests: netfilter: ipvs.sh Signed-off-by: Haishuang Yan Haishuang Yan (3): selftests: netfilter: add ipvs test script selftests: netfilter: add ipvs nat test case

[net-next 1/2] ipvs: batch __ip_vs_cleanup

2019-07-13 Thread Haishuang Yan
It's better to batch __ip_vs_cleanup to speedup ipvs connections dismantle. Signed-off-by: Haishuang Yan --- include/net/ip_vs.h | 2 +- net/netfilter/ipvs/ip_vs_core.c | 29 + net/netfilter/ipvs/ip_vs_ctl.c | 13 ++--- 3 files change

[net-next 2/2] ipvs: batch __ip_vs_dev_cleanup

2019-07-13 Thread Haishuang Yan
It's better to batch __ip_vs_cleanup to speedup ipvs devices dismantle. Signed-off-by: Haishuang Yan --- net/netfilter/ipvs/ip_vs_core.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_c

[net-next 0/2] ipvs: speedup ipvs netns dismantle

2019-07-13 Thread Haishuang Yan
Implement exit_batch() method to dismantle more ipvs netns per round. Haishuang Yan (2): ipvs: batch __ip_vs_cleanup ipvs: batch __ip_vs_dev_cleanup include/net/ip_vs.h | 2 +- net/netfilter/ipvs/ip_vs_core.c | 49 + net/netfilter/ipvs

[PATCH] sit: use dst_cache in ipip6_tunnel_xmit

2019-07-14 Thread Haishuang Yan
Same as other ip tunnel, use dst_cache in xmit action to avoid unnecessary fib lookups. Signed-off-by: Haishuang Yan --- net/ipv6/sit.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 8061089..b2ccbc4 100644 --- a/net/ipv6

[PATCH] ipip: validate header length in ipip_tunnel_xmit

2019-07-24 Thread Haishuang Yan
We need the same checks introduced by commit cb9f1b783850 ("ip: validate header length on virtual device xmit") for ipip tunnel. Signed-off-by: Haishuang Yan --- net/ipv4/ipip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 43adfc

[PATCH] ipip: validate header length in ipip_tunnel_xmit

2019-07-24 Thread Haishuang Yan
We need the same checks introduced by commit cb9f1b783850 ("ip: validate header length on virtual device xmit") for ipip tunnel. Signed-off-by: Haishuang Yan --- net/ipv4/ipip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 43adfc

[PATCH] ip6_tunnel: fix possible use-after-free on xmit

2019-07-25 Thread Haishuang Yan
on encapsulated packets") Signed-off-by: Haishuang Yan --- net/ipv6/ip6_tunnel.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 3134fbb..754a484 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -127

[PATCH] ip6_gre: reload ipv6h in prepare_ip6gre_xmit_ipv6

2019-07-24 Thread Haishuang Yan
Since ip6_tnl_parse_tlv_enc_lim() can call pskb_may_pull() which may change skb->data, so we need to re-load ipv6h at the right place. Fixes: 898b29798e36 ("ip6_gre: Refactor ip6gre xmit codes") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 3 ++- 1 fi

Re: [PATCH] openvswitch: Fix a possible memory leak on dst_cache

2019-07-18 Thread Haishuang Yan
> On 2019年7月19日, at 上午6:12, Gregory Rose wrote: > > On 7/18/2019 9:07 AM, Haishuang Yan wrote: >> dst_cache should be destroyed when fail to add flow actions. >> >> Fixes: d71785ffc7e7 ("net: add dst_cache to ovs vxlan lwtunnel") >> Signed-off-by

Re: [PATCH] ip6_gre: simplify gre header parsing in ip6gre_err

2018-09-10 Thread Haishuang Yan
> On 2018年9月10日, at 下午11:36, Jiri Benc wrote: > > On Mon, 10 Sep 2018 16:25:09 +0800, Haishuang Yan wrote: >> +if (gre_parse_header(skb, &tpi, &csum_err, htons(ETH_P_IPV6), >> + offset) < 0) { >> +if (!cs

[PATCH v2] geneve: fix max_mtu setting

2016-07-02 Thread Haishuang Yan
For ipv6+udp+geneve encapsulation data, the max_mtu should subtract sizeof(ipv6hdr), instead of sizeof(iphdr). Signed-off-by: Haishuang Yan --- Changes in v2: - As suggested by Jesse Gross, treat AF_UNSPEC same as AF_INET4 to avoid disallowing potentially valid configrations. --- drivers/net

[PATCH] sched, cgroup: enclose root_task_group with macro CONFIG_CGROUP_SCHED.

2016-10-30 Thread Haishuang Yan
root_task_group defined in sched/core.c is enclosed by CONFIG_CGROUP_SCHED, so the export declaration should also be enclosed. Signed-off-by: Haishuang Yan --- include/linux/init_task.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/init_task.h b/include

[PATCH] geneve: fix ip_hdr_len reserved for geneve6 tunnel.

2016-11-27 Thread Haishuang Yan
It shold reserved sizeof(ipv6hdr) for geneve in ipv6 tunnel. Fixes: c3ef5aa5e5 ('geneve: Merge ipv4 and ipv6 geneve_build_skb()') Signed-off-by: Haishuang Yan --- drivers/net/geneve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/geneve.c b/d

[PATCH] vxlan: fix a potential issue when create a new vxlan fdb entry.

2016-11-27 Thread Haishuang Yan
vxlan_fdb_append may return error, so add the proper check, otherwise it will cause memory leak. Signed-off-by: Haishuang Yan --- drivers/net/vxlan.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 21e92be..3b7b237

[PATCH] ipv4: Namespaceify tcp_tw_reuse knob

2016-12-24 Thread Haishuang Yan
Signed-off-by: Haishuang Yan --- include/net/netns/ipv4.h | 1 + include/net/tcp.h | 1 - net/ipv4/sysctl_net_ipv4.c | 14 +++--- net/ipv4/tcp_ipv4.c| 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net

[PATCH v2] ipv4: Namespaceify tcp_tw_reuse knob

2016-12-24 Thread Haishuang Yan
Different namespaces might have different requirements to reuse TIME-WAIT sockets for new connections. This might be required in cases where different namespace applications are in place which require TIME_WAIT socket connections to be reduced independently of the host. Signed-off-by: Haishuang

[PATCH 2/2] ipv4: Namespaceify tcp_max_syn_backlog knob

2016-12-28 Thread Haishuang Yan
Different namespace application might require different maximal number of remembered connection requests. Signed-off-by: Haishuang Yan --- include/net/netns/ipv4.h | 1 + include/net/request_sock.h | 4 +--- net/core/request_sock.c| 2 -- net/ipv4/sysctl_net_ipv4.c | 14

[PATCH 1/2] ipv4: Namespaceify tcp_tw_recycle and tcp_max_tw_buckets knob

2016-12-28 Thread Haishuang Yan
Different namespace application might require fast recycling TIME-WAIT sockets independently of the host. Signed-off-by: Haishuang Yan --- include/net/inet_timewait_sock.h | 13 + include/net/netns/ipv4.h | 11 +++ include/net/tcp.h| 1 - net/ipv4

[PATCH v2] vxlan: fix a potential issue when create a new vxlan fdb entry.

2016-11-28 Thread Haishuang Yan
vxlan_fdb_append may return error, so add the proper check, otherwise it will cause memory leak. Signed-off-by: Haishuang Yan Changes in v2: - Unnecessary to initialize rc to zero. --- drivers/net/vxlan.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH] openvswitch: add sanity check in queue_userspace_packet.

2016-11-28 Thread Haishuang Yan
kernel will crash in oops if genlmsg_put return NULL, so add the sanity check. Signed-off-by: Haishuang Yan --- net/openvswitch/datapath.c | 4 1 file changed, 4 insertions(+) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 2d4c4d3..ceb1b1e 100644 --- a/net

[PATCH] geneve: fix max_mtu setting

2016-06-25 Thread Haishuang Yan
For ipv6+udp+geneve encapsulation data, the max_mtu should subtract sizeof(ipv6hdr), instead of sizeof(iphdr). Signed-off-by: Haishuang Yan --- drivers/net/geneve.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index

[PATCH] openvswitch: Use proper buffer size in nla_memcpy

2016-03-28 Thread Haishuang Yan
For the input parameter count, it's better to use the size of destination buffer size, as nla_memcpy would take into account the length of the source netlink attribute when a data is copied from an attribute. Signed-off-by: Haishuang Yan --- net/openvswitch/conntrack.c | 3 ++- 1 file ch

[PATCH] bridge: Allow set bridge ageing time when switchdev disabled

2016-03-29 Thread Haishuang Yan
When NET_SWITCHDEV=n, switchdev_port_attr_set will return -EOPNOTSUPP, we should ignore this error code and continue to set the ageing time. Signed-off-by: Haishuang Yan --- net/bridge/br_stp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_stp.c b/net/bridge

[PATCH] gre: fix return value of gre_rcv

2016-03-22 Thread Haishuang Yan
Dropped skb's should be documented by an appropriate return value. Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason. Signed-off-by: Haishuang Yan --- net/ipv4/ip_gre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net

[PATCH] vlan: propagate gso_min_segs

2016-03-22 Thread Haishuang Yan
vlan drivers lack proper propagation of gso_min_segs from lower device. Signed-off-by: Haishuang Yan --- drivers/net/ipvlan/ipvlan_main.c | 2 ++ drivers/net/macvlan.c| 1 + net/8021q/vlan.c | 1 + net/8021q/vlan_dev.c | 1 + 4 files changed, 5 insertions

[PATCH] net: ping: make ping_v6_sendmsg static

2016-03-23 Thread Haishuang Yan
As ping_v6_sendmsg is used only in this file, making it static The body of "pingv6_prot" and "pingv6_protosw" were moved at the middle of the file, to avoid having to declare some static prototypes. Signed-off-by: Haishuang Yan --- include/net/ping.h | 1 - net

Re: [PATCH v2,net-next] ip6_gre: fix a pontential issue in ip6erspan_rcv

2017-12-19 Thread Haishuang Yan
> On 2017年12月19日, at 下午11:34, David Miller wrote: > > From: Haishuang Yan > Date: Sat, 16 Dec 2017 10:25:25 +0800 > >> pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at >> the right place. >> >> Fixes: 5a963eb61b7c (

Re: [PATCH v2,net-next 1/2] ip_gre: fix potential memory leak in erspan_rcv

2017-12-19 Thread Haishuang Yan
> On 2017年12月19日, at 下午11:36, David Miller wrote: > > From: Haishuang Yan > Date: Sat, 16 Dec 2017 10:48:38 +0800 > >> If md is NULL, tun_dst must be freed, otherwise it will cause memory >> leak. >> >> Fixes: 1a66a836da6 ("gre: add collect_

[PATCH v3,net-next] ip6_gre: fix a pontential issue in ip6erspan_rcv

2017-12-19 Thread Haishuang Yan
pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at the right place. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Cc: William Tu Acked-by: William Tu Signed-off-by: Haishuang Yan --- Change since v3: * Rebase on latest master branch.

[PATCH v3,net-next 1/2] ip_gre: fix potential memory leak in erspan_rcv

2017-12-19 Thread Haishuang Yan
If md is NULL, tun_dst must be freed, otherwise it will cause memory leak. Fixes: 1a66a836da6 ("gre: add collect_md mode to ERSPAN tunnel") Cc: William Tu Signed-off-by: Haishuang Yan --- Changes since v3: * Rebase on latest master branch. * Fix wrong commit information. ---

[PATCH v3,net-next 0/2] net: erspan: fix potential memory leak

2017-12-19 Thread Haishuang Yan
This patch series fix potential memory leak issue. Haishuang Yan (2): ip_gre: fix potential memory leak in erspan_rcv ip6_gre: fix potential memory leak in ip6erspan_rcv net/ipv4/ip_gre.c | 4 +++- net/ipv6/ip6_gre.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) -- 1.8.3.1

[PATCH v3,net-next 2/2] ip6_gre: fix potential memory leak in ip6erspan_rcv

2017-12-19 Thread Haishuang Yan
If md is NULL, tun_dst must be freed, otherwise it will cause memory leak. Fixes: ef7baf5e083c ("ip6_gre: add ip6 erspan collect_md mode") Cc: William Tu Signed-off-by: Haishuang Yan --- Changes since v3: * Rebase on latest master branch. * Fix wrong commit information. ---

[PATCH v3,net-next 0/2] net: erspan: fix erspan_rcv/ip6erspan_rcv error path

2017-12-19 Thread Haishuang Yan
This patch series fix potential issue in error path. Haishuang Yan (2): ip_gre: fix error path when erspan_rcv failed ip6_gre: fix error path when ip6erspan_rcv failed net/ipv4/ip_gre.c | 2 ++ net/ipv6/ip6_gre.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) -- 1.8.3.1

[PATCH v3,net-next 1/2] ip_gre: fix error path when erspan_rcv failed

2017-12-19 Thread Haishuang Yan
When erspan_rcv call return PACKET_REJECT, we shoudn't call ipgre_rcv to process packets again, instead send icmp unreachable message in error path. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Acked-by: William Tu Cc: William Tu Signed-off-by

[PATCH v3,net-next 2/2] ip6_gre: fix error path when ip6erspan_rcv failed

2017-12-19 Thread Haishuang Yan
Same as ipv4 code, when ip6erspan_rcv call return PACKET_REJECT, we should call icmpv6_send to send icmp unreachable message in error path. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Acked-by: William Tu Cc: William Tu Signed-off-by: Haishuang Yan --- Chang

[PATCH 1/2] ip_gre: fix potential memory leak in erspan_rcv

2017-12-14 Thread Haishuang Yan
If md is NULL, tun_dst must be freed, otherwise it will cause memory leak. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv4/ip_gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH 2/2] ip6_gre: fix potential memory leak in ip6erspan_rcv

2017-12-14 Thread Haishuang Yan
If md is NULL, tun_dst must be freed, otherwise it will cause memory leak Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH 1/2] ip_gre: fix error path when erspan_rcv failed

2017-12-14 Thread Haishuang Yan
When erspan_rcv call return PACKET_REJECT, we shoudn't call ipgre_rcv to process packets again, instead send icmp unreachable message in error path. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ip

[PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed

2017-12-14 Thread Haishuang Yan
Same as ipv4 code, when ip6erspan_rcv call return PACKET_REJECT, we should call icmpv6_send to send icmp unreachable message in error path. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 3 +

[PATCH] ip_gre: fix wrong return value of erspan_rcv

2017-12-14 Thread Haishuang Yan
If pskb_may_pull return failed, return PACKET_REJECT instead of -ENOMEM. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv4/ip_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] ip6_gre: fix a pontential issue in ip6erspan_rcv

2017-12-14 Thread Haishuang Yan
pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at the right place. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Cc: William Tu Signed-off-by: Haishuang Yan --- net/ipv6/ip6_gre.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-

[PATCH v2,net-next] ip6_gre: fix a pontential issue in ip6erspan_rcv

2017-12-15 Thread Haishuang Yan
pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at the right place. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Acked-by: William Tu Cc: William Tu Signed-off-by: Haishuang Yan --- Change since v2: * Rebase on latest master.

[PATCH v2,net-next 1/2] ip_gre: fix potential memory leak in erspan_rcv

2017-12-15 Thread Haishuang Yan
If md is NULL, tun_dst must be freed, otherwise it will cause memory leak. Fixes: 1a66a836da6 ("gre: add collect_md mode to ERSPAN tunnel") Cc: William Tu Signed-off-by: Haishuang Yan Change since v2: * Rebase on latest master branch. * Correct wrong fix information. --- net/ipv

[PATCH v2,net-next 2/2] ip6_gre: fix potential memory leak in ip6erspan_rcv

2017-12-15 Thread Haishuang Yan
If md is NULL, tun_dst must be freed, otherwise it will cause memory leak. Fixes: ef7baf5e083c ("ip6_gre: add ip6 erspan collect_md mode") Cc: William Tu Signed-off-by: Haishuang Yan Change since v2: * Rebase on latest master branch. * Correct wrong fix information. --- net/ipv6

[PATCH v2,net-next 2/2] ip6_gre: fix error path when ip6erspan_rcv failed

2017-12-15 Thread Haishuang Yan
Same as ipv4 code, when ip6erspan_rcv call return PACKET_REJECT, we should call icmpv6_send to send icmp unreachable message in error path. Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") Acked-by: William Tu Cc: William Tu Signed-off-by: Haishuang Yan Chang

[PATCH v2,net-next 1/2] ip_gre: fix error path when erspan_rcv failed

2017-12-15 Thread Haishuang Yan
When erspan_rcv call return PACKET_REJECT, we shoudn't call ipgre_rcv to process packets again, instead send icmp unreachable message in error path. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Acked-by: William Tu Cc: William Tu Signed-off-by: Haishua

[PATCH net-next 2/2] geneve: speedup geneve tunnels dismantle

2017-12-16 Thread Haishuang Yan
Since we now hold RTNL lock in geneve_exit_net, it's better batch them to speedup geneve tunnel dismantle. Signed-off-by: Haishuang Yan --- drivers/net/geneve.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/geneve.c b/driver

[PATCH net-next 0/2] net: speedup geneve/vxlan tunnels dismantle

2017-12-16 Thread Haishuang Yan
This patch series add batching to vxlan/geneve tunnels so that netns dismantles are less costly. Haishuang Yan (2): vxlan: speedup vxlan tunnels dismantle geneve: speedup geneve tunnels dismantle drivers/net/geneve.c | 24 drivers/net/vxlan.c | 26

[PATCH net-next 1/2] vxlan: speedup vxlan tunnels dismantle

2017-12-16 Thread Haishuang Yan
Since we now hold RTNL lock in vxlan_exit_net, it's better to batch them to speedup vxlan tunnels dismantle. Signed-off-by: Haishuang Yan --- drivers/net/vxlan.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/net/vxlan.c b/driver

[PATCH v4 1/2] ip_tunnel: fix ip tunnel lookup in collect_md mode

2017-09-12 Thread Haishuang Yan
drops on fallback device will be increased as expected. Fixes: 2e15ea390e6f ("ip_gre: Add support to collect tunnel metadata.") Cc: Pravin B Shelar Signed-off-by: Haishuang Yan --- Change since v4: * Make the commit message more clearer. * Fix wrong recipient addresss --- net/ipv4/

[PATCH v4 2/2] ip6_tunnel: fix ip6 tunnel lookup in collect_md mode

2017-09-12 Thread Haishuang Yan
drops on fallback device will be increased as expected. Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") Cc: Alexei Starovoitov Signed-off-by: Haishuang Yan --- Change since v4: * Make the commit message more clearer * Fix wrong recipient address --- net/ip

[PATCH] ipv4: Namespaceify tcp_fastopen knob

2017-09-12 Thread Haishuang Yan
Different namespace application might require enable TCP Fast Open feature independently of the host. Reported-by: Luca BRUNO Signed-off-by: Haishuang Yan --- include/net/netns/ipv4.h | 2 ++ include/net/tcp.h | 1 - net/ipv4/af_inet.c | 7 --- net/ipv4

[PATCH v2] ipv4: Namespaceify tcp_fastopen knob

2017-09-13 Thread Haishuang Yan
Different namespace application might require enable TCP Fast Open feature independently of the host. Reported-by: Luca BRUNO Signed-off-by: Haishuang Yan --- Change since v2: * Remove unrelated change by mistake --- include/net/netns/ipv4.h | 2 ++ include/net/tcp.h | 1 - net

[PATCH] be2net: Fix some u16 fields appropriately

2017-08-27 Thread Haishuang Yan
In be_tx_compl_process, frag_index declared as u32, so it's better to declare last_index as u32 also. CC: Ajit Khaparde Fixes: b0fd2eb28bd4 ("be2net: Declare some u16 fields as u32 to improve performance") Signed-off-by: Haishuang Yan --- drivers/net/ethernet/emulex/bene

  1   2   >