Re: [PATCHv2] net/ipv6: add sysctl option accept_ra_hop_limit

2015-07-28 Thread Hangbin Liu
2015-07-28 11:58 GMT+08:00 YOSHIFUJI Hideaki hideaki.yoshif...@miraclelinux.com: Hi, Hangbin Liu wrote: 2015-07-28 7:50 GMT+08:00 YOSHIFUJI Hideaki/吉藤英明 hideaki.yoshif...@miraclelinux.com: Hi, Hangbin Liu wrote: Commit 6fd99094de2b (ipv6: Don't reduce hop limit for an interface) disabled

Re: [PATCHv3] net/ipv6: add sysctl option accept_ra_min_hop_limit

2015-07-29 Thread Hangbin Liu
2015-07-30 8:45 GMT+08:00 YOSHIFUJI Hideaki hideaki.yoshif...@miraclelinux.com: How about ignoring hop limit without message is configured value is larger than 255, BTW? Although set accept_ra_min_hop_limit great than 255 is meaningless, there is also no need to check it since

[PATCH net-next v4] net/ipv6: add sysctl option accept_ra_min_hop_limit

2015-07-29 Thread Hangbin Liu
-zero, the host SHOULD set its CurHopLimit variable to the received value. So add sysctl option accept_ra_min_hop_limit to let user choose the minimum hop limit value they can accept from RA. And set default to 1 to meet RFC standards. Signed-off-by: Hangbin Liu liuhang...@gmail.com

Re: [PATCHv2] net/ipv6: add sysctl option accept_ra_hop_limit

2015-07-29 Thread Hangbin Liu
2015-07-29 10:14 GMT+08:00 YOSHIFUJI Hideaki hideaki.yoshif...@miraclelinux.com: May be we use a “hop limit range instead? How do you think? I think name of sysctl is the same as you suggested and change the semantics. default value is 0 to accept all hotlimit value as before and people can

[PATCHv3] net/ipv6: add sysctl option accept_ra_min_hop_limit

2015-07-29 Thread Hangbin Liu
-zero, the host SHOULD set its CurHopLimit variable to the received value. So add sysctl option accept_ra_min_hop_limit to let user choose the minimum hop limit value they can accept from RA. And set default to 1 to meet RFC standards. Signed-off-by: Hangbin Liu liuhang...@gmail.com

[[PATCH net-next v5] net/ipv6: add sysctl option accept_ra_min_hop_limit

2015-07-30 Thread Hangbin Liu
-zero, the host SHOULD set its CurHopLimit variable to the received value. So add sysctl option accept_ra_min_hop_limit to let user choose the minimum hop limit value they can accept from RA. And set default to 1 to meet RFC standards. Signed-off-by: Hangbin Liu liuhang...@gmail.com

Re: [PATCHv3] net/ipv6: add sysctl option accept_ra_min_hop_limit

2015-07-29 Thread Hangbin Liu
Hi Yoshifuji-san, Please see comments in the mail. 2015-07-29 18:39 GMT+08:00 YOSHIFUJI Hideaki hideaki.yoshif...@miraclelinux.com: Hi, Thank you for you updated patch. Hangbin Liu wrote: Commit 6fd99094de2b (ipv6: Don't reduce hop limit for an interface) disabled accept hop limit from RA

Re: [PATCHv2] net/ipv6: add sysctl option accept_ra_hop_limit

2015-07-27 Thread Hangbin Liu
2015-07-28 7:50 GMT+08:00 YOSHIFUJI Hideaki/吉藤英明 hideaki.yoshif...@miraclelinux.com: Hi, Hangbin Liu wrote: Commit 6fd99094de2b (ipv6: Don't reduce hop limit for an interface) disabled accept hop limit from RA if it is higher than the current hop limit for security stuff. But this behavior

[PATCH] net/ipv6: add sysctl option accept_ra_hop_limit

2015-07-23 Thread Hangbin Liu
Cur Hop Limit value is non-zero, the host SHOULD set its CurHopLimit variable to the received value. So add sysctl option accept_ra_hop_limit to let user choose whether accept hop limit info in RA. Signed-off-by: Hangbin Liu liuhang...@gmail.com Acked-by: Hannes Frederic Sowa han

Re: [PATCH] net/ipv6: add sysctl option accept_ra_hop_limit

2015-07-24 Thread Hangbin Liu
2015-07-24 12:48 GMT+08:00 YOSHIFUJI Hideaki hideaki.yoshif...@miraclelinux.com: Hi, Hangbin Liu wrote: Commit 6fd99094de2b (ipv6: Don't reduce hop limit for an interface) disabled accept hop limit from RA if it is higher than the current hop limit for security stuff. But this behavior kind

[PATCHv2] net/ipv6: add sysctl option accept_ra_hop_limit

2015-07-27 Thread Hangbin Liu
Cur Hop Limit value is non-zero, the host SHOULD set its CurHopLimit variable to the received value. So add sysctl option accept_ra_hop_limit to let user choose whether accept hop limit info in RA. Signed-off-by: Hangbin Liu liuhang...@gmail.com --- Documentation/networking/ip-sysctl.txt | 11

Re: [PATCH net-next] Revert "net/ipv6: add sysctl option accept_ra_min_hop_limit"

2015-09-10 Thread Hangbin Liu
Hi Sabrina, 2015-09-10 17:19 GMT+08:00 Sabrina Dubroca <s...@queasysnail.net>: > Hello, > > 2015-09-10, 10:54:38 +0800, Hangbin Liu wrote: >> > Can we still modify the behavior of this sysctl? It's already been in >> > Linus's tree for a while, but i

Re: [PATCH net-next] Revert "net/ipv6: add sysctl option accept_ra_min_hop_limit"

2015-09-09 Thread Hangbin Liu
Allowing an RA to update the hop limit if > >current hop limit < RA.hop_limit < accept_ra_min_hop_limit > > might also be desirable, but I'm not so sure about this case. Yes, and we also should allow an RA to update the hop limit if accept_ra_min_hop_limit <= RA.hop_limit < current hop limit e.g accept_ra_min_hop_limit = RA.hop_limit =64, current hop limit = 128 Thanks Hangbin Liu -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH iproute2 net-next 1/2] iproute2: ip-route.8.in: Add missing '[' before 'pref'

2015-12-24 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- man/man8/ip-route.8.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 72d8d77..5b45bc2 100644 --- a/man/man8/ip-route.8.in +++ b/man/man8/ip-route.8.in @@ -128,7

[PATCH iproute2 net-next 2/2] iproute2: ip-route.8.in: Add expires option for ip route

2015-12-24 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- man/man8/ip-route.8.in | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 5b45bc2..c5494f8 100644 --- a/man/man8/ip-route.8.in +++ b/man/man8/ip-r

[PATCH iproute2] ip/iproute: allow routes to be configured with expire values

2015-12-21 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- include/linux/rtnetlink.h | 1 + ip/iproute.c | 11 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 3244947..ff2fe31 100644 --- a/i

[PATCH net-next] net/multicast: should not send source list records when have filter mode change

2016-08-02 Thread Hangbin Liu
ave psf->sf_crcount, we stop add records and decrease sf_crcount directly Reference: https://www.ietf.org/mail-archive/web/magma/current/msg01274.html Signed-off-by: Hangbin Liu <liuhang...@gmail.com> Acked-by: Hannes Frederic Sowa <han...@stressinduktion.org> --- net/ipv4/igmp.c |

Re: [PATCH net-next] net/multicast: should not send source list records when have filter mode change

2016-08-02 Thread Hangbin Liu
Hi, Here are some tests with this patch. It's hard to test all scenarios. So I just did a part. And all looks good so far. Please tell me if there is anything unclear. Thanks Hangbin Group: 239.1.1.1 A: 192.168.1.1 B: 192.168.1.2 C: 192.168.1.3

[PATCHv2 iproute2 net-next] man: ip-link.8: Document bridge_slave fdb_flush option

2017-02-08 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- man/man8/ip-link.8.in | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 469bb43..651a255 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -1429,6 +

[PATCH iproute2 net-next] man: ip-link.8: Document bridge_slave fdb_flush option

2017-02-08 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- man/man8/ip-link.8.in | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 469bb43..116034d 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -1429,6 +

[PATCH net] igmp, mld: Fix memory leak in igmpv3/mld_del_delrec()

2017-02-08 Thread Hangbin Liu
") Fixes: 1666d49e1d41 ("mld: do not remove mld souce list info when ...") Reported-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- net/ipv4/igmp.c | 1 + net/ipv6/mcast.c | 1 + 2 files changed, 2 insertions(+) diff --git

[PATCH net 2/4] ipvs: Document sysctl sync_qlen_max and sync_sock_size

2017-02-16 Thread Hangbin Liu
Document sysctl sync_qlen_max and sync_sock_size based on commit 1c003b1580e2 ("ipvs: wakeup master thread"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs-sysctl.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/Document

[PATCH net 0/4] update ipvs sysctl document

2017-02-16 Thread Hangbin Liu
Fix and add some new ipvs sysctl options. Also use tab instead of whitespaces to indent the descriptions. Hangbin Liu (4): ipvs: fix sync_threshold description and add sync_refresh_period, sync_retries ipvs: Document sysctl sync_qlen_max and sync_sock_size ipvs: Document sysctl

[PATCH net 4/4] ipvs: Document sysctl pmtu_disc

2017-02-16 Thread Hangbin Liu
Document sysctl pmtu_disc based on commit 3654e61137db ("ipvs: add pmtu_disc option to disable IP DF for TUN packets"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs-sysctl.txt | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH net 1/4] ipvs: fix sync_threshold description and add sync_refresh_period, sync_retries

2017-02-16 Thread Hangbin Liu
Fix sync_threshold description which should have two values. Also add sync_refresh_period and sync_retries based on commit 749c42b620a9 ("ipvs: reduce sync rate with time thresholds"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs

Re: [PATCH net 0/4] update ipvs sysctl document

2017-02-20 Thread Hangbin Liu
Hi Julian, Thanks a lot for the comments. I will send a v2 patch. Regards Hangbin 2017-02-19 22:04 GMT+08:00 Julian Anastasov <j...@ssi.bg>: > > Hello, > > On Fri, 17 Feb 2017, Hangbin Liu wrote: > >> Fix and add some new ipvs sysctl options. Also use

[PATCHv2 net-next 4/4] ipvs: Document sysctl pmtu_disc

2017-02-20 Thread Hangbin Liu
Document sysctl pmtu_disc based on commit 3654e61137db ("ipvs: add pmtu_disc option to disable IP DF for TUN packets"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs-sysctl.txt | 8 1 file changed, 8 insertions(+) diff --git

[PATCHv2 net-next 1/4] ipvs: fix sync_threshold description and add sync_refresh_period, sync_retries

2017-02-20 Thread Hangbin Liu
Fix sync_threshold description which should have two values. Also add sync_refresh_period and sync_retries based on commit 749c42b620a9 ("ipvs: reduce sync rate with time thresholds"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs

[PATCHv2 net-next 3/4] ipvs: Document sysctl sync_ports

2017-02-20 Thread Hangbin Liu
Document sysctl sync_ports based on commit f73181c8288f ("ipvs: add support for sync threads"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs-sysctl.txt | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/networking/ip

[PATCHv2 net-next 0/4] update ipvs sysctl document

2017-02-20 Thread Hangbin Liu
Fix and add some new ipvs sysctl options. Also use tab instead of whitespaces to indent the descriptions. V2: Fix some descriptions based on Julian's advice. Hangbin Liu (4): ipvs: fix sync_threshold description and add sync_refresh_period, sync_retries ipvs: Document sysctl sync_qlen_max

[PATCHv2 net-next 2/4] ipvs: Document sysctl sync_qlen_max and sync_sock_size

2017-02-20 Thread Hangbin Liu
Document sysctl sync_qlen_max and sync_sock_size based on commit 1c003b1580e2 ("ipvs: wakeup master thread"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs-sysctl.txt | 14 ++ 1 file changed, 14 insertions(+) diff --git

[PATCH net 3/4] ipvs: Document sysctl sync_ports

2017-02-16 Thread Hangbin Liu
Document sysctl sync_ports based on commit f73181c8288f ("ipvs: add support for sync threads"). Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ipvs-sysctl.txt | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/networking/ip

[PATCHv2 iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_FDB_FLUSH attribute in iproute2 so it can flush bridge fdb dynamic entries. Reviewed-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 5 - 1 fil

[PATCHv2 iproute2 net-next 4/5] iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION attribute in iproute2 so it can change the mcast igmp version. Reviewed-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 +

[PATCHv2 iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED attribute in iproute2 so it can enable/disable vlan stats accounting. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1 file changed, 13 insertions(+) diff --git a/ip/iplink_brid

[PATCHv2 iproute2 net-next 5/5] iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_MCAST_MLD_VERSION attribute in iproute2 so it can change the mcast mld version. Reviewed-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1

[PATCHv2 iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED attribute in iproute2 so it can enable/disable mcast stats accounting. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1 file changed, 13 insertions(+) diff --git a/ip/iplink_br

[PATCHv2 iproute2 net-next 0/5] add latest bridge netlink options

2017-01-17 Thread Hangbin Liu
Add the bridge netlink attributes added to kernel recently. v2: rename vlan/mcast_state to vlan/mcast_stats_enabled as suggested by Nikolay. The previous name has different meaning and will mislead people. I will post a separate patch for IFLA_BRPORT_FLUSH support. Hangbin Liu (5): iplink

[PATCH iproute2 net-next] iplink: bridge_slave: add support for IFLA_BRPORT_FLUSH

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BRPORT_FLUSH attribute in iproute2 so it can flush bridge slave's fdb dynamic entries. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge_slave.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --gi

[PATCH iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED attribute in iproute2 so it can change the vlan state. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1 file changed, 13 insertions(+) diff --git a/ip/iplink_bridge.

[PATCH iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_FDB_FLUSH attribute in iproute2 so it can flush bridge fdb dynamic entries. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/iplink_bridge.

[PATCH iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED attribute in iproute2 so it can change the mcast state. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1 file changed, 13 insertions(+) diff --git a/ip/iplink_bridge.

[PATCH iproute2 net-next 4/5] iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION attribute in iproute2 so it can change the mcast igmp version. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1 file changed, 13 insertions(+) diff --git a/ip/iplink_bridge.

[PATCH iproute2 net-next 0/5] add latest bridge netlink options

2017-01-17 Thread Hangbin Liu
Add the bridge netlink attributes added to kernel recently. Hangbin Liu (5): iplink: bridge: add support for IFLA_BR_FDB_FLUSH iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED iplink: bridge: add support

[PATCH iproute2 net-next 5/5] iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION

2017-01-17 Thread Hangbin Liu
This patch implements support for the IFLA_BR_MCAST_MLD_VERSION attribute in iproute2 so it can change the mcast mld version. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bridge.c | 13 + 1 file changed, 13 insertions(+) diff --git a/ip/iplink_bridge.

[PATCH iproute2] ip route: check ftell, fseek return value

2016-09-06 Thread Hangbin Liu
ftell() may return -1 in error case, which is not handled and therefore pass a negative offset to fseek(). The return code of fseek() is also not checked. Reported-by: Phil Sutter <p...@nwl.cc> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iproute.c | 11 +-- 1 fil

[PATCH iproute] gitignore: Ignore 'tags' file generated by ctags

2016-09-06 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ef03b17..74a5496 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ Config # cscope cscope.* ncscope.* +tags TAGS # git files t

[PATCH iproute2] ip link: fix up bond/bridge slave id

2016-09-06 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iplink_bond_slave.c | 2 +- ip/iplink_bridge_slave.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ip/iplink_bond_slave.c b/ip/iplink_bond_slave.c index 9c60dea..8a3104b 100644 --- a/ip/iplink_bond_slave.c

[PATCH iproute2 net-next] nstat: add sctp snmp support

2016-09-02 Thread Hangbin Liu
SCTP module was not load by default. But this should be OK since we will not load table if fdopen() failed. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- misc/nstat.c | 17 + 1 file changed, 17 insertions(+) diff --git a/misc/nstat.c b/misc/nstat.c index 6143719..8

[PATCHv2 iproute2 net-next] nstat: add sctp snmp support

2016-09-04 Thread Hangbin Liu
SCTP module was not load by default. But this should be OK since we will not load table if fdopen() failed, also opening the proc file won't load SCTP kernel module. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- misc/nstat.c | 18 ++ 1 file changed, 18 insertions(+)

Re: [PATCH iproute2 net-next] nstat: add sctp snmp support

2016-09-04 Thread Hangbin Liu
2016-09-02 18:09 GMT+08:00 Phil Sutter : > Did you forget to add the load call to update_db(), or am I missing > something? Opps, forgot to add it there. I will send patchv2 for this issue. Thanks Hangbin > Apart from that, looks nice and clean. > > Cheers, Phil

Re: [PATCH iproute2] ip link: fix up bond/bridge slave id

2016-09-07 Thread Hangbin Liu
On Tue, Sep 06, 2016 at 11:31:24AM +0300, Nikolay Aleksandrov wrote: > NAK, this will actually force the iplink slave logic to always lookup the > linkutil symbol. Please check iplink.c and how slave linkutil structs are > found. > The first part of the “bridge/bond_slave” is extracted from the

Re: [PATCH iproute2] ip route: check ftell, fseek return value

2016-09-07 Thread Hangbin Liu
On Tue, Sep 06, 2016 at 11:18:00AM +, David Laight wrote: > From: Hangbin Liu > > Sent: 06 September 2016 07:40 > > ftell() may return -1 in error case, which is not handled and therefore > > pass a > > negative offset to fseek(). The return code of

[PATCHv2 iproute2] ip route: check ftell, fseek return value

2016-09-07 Thread Hangbin Liu
ftell() may return -1 in error case, which is not handled and therefore pass a negative offset to fseek(). The return code of fseek() is also not checked. Reported-by: Phil Sutter <p...@nwl.cc> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iproute.c | 10 +- 1 fil

[PATCH iproute2] devlink: Convert conditional in dl_argv_handle_port() to switch()

2016-10-08 Thread Hangbin Liu
Discovered by Phil's covscan. The final return statement is never reached. This is not inherently clear from looking at the code, so change the conditional to a switch() statement which should clarify this. CC: Phil Sutter <p...@nwl.cc> Signed-off-by: Hangbin Liu <liuhang...@

[PATCH iproute2] ip: Use specific slave id

2016-09-20 Thread Hangbin Liu
The original bond/bridge/vrf and slaves use same id, which make people confused. Use bond/bridge/vrf_slave as id name will make code more clear. Acked-by: Phil Sutter <psut...@redhat.com> Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/ip_common.h | 2 -- ip

Re: [PATCH iproute2 2/2] ip rule: add selector support

2016-09-22 Thread Hangbin Liu
2016-09-22 16:45 GMT+08:00 Phil Sutter <p...@nwl.cc>: > On Thu, Sep 22, 2016 at 02:28:49PM +0800, Hangbin Liu wrote: > [...] >> diff --git a/man/man8/ip-rule.8 b/man/man8/ip-rule.8 >> index 3508d80..ec0e31d 100644 >> --- a/man/man8/ip-rule.8 >> +++ b/man/man8/ip

[PATCHv2 iproute2 2/2] ip rule: add selector support

2016-09-22 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iprule.c| 180 +++-- man/man8/ip-rule.8 | 6 +- 2 files changed, 180 insertions(+), 6 deletions(-) diff --git a/ip/iprule.c b/ip/iprule.c index e18505f..42fb6af 100644 --

[PATCHv2 iproute2 1/2] ip rule: merge ip rule flush and list, save together

2016-09-22 Thread Hangbin Liu
iprule_flush() and iprule_list_or_save() both call function rtnl_wilddump_request() and rtnl_dump_filter(). So merge them together just like other files do. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iprule.c | 121 +++--

[PATCHv2 iproute2 0/2] ip rule: merger iprule_flush and add selector support

2016-09-22 Thread Hangbin Liu
When merge iprule_flush() and iprule_list_or_save(). Renamed rtnl_filter_t filter to filter_fn because we want to use global variable 'filter' to filter nlmsg in the next patch. Hangbin Liu (2): ip rule: merge ip rule flush and list, save together ip rule: add selector support ip/iprule.c

[PATCH iproute2 1/2] ip rule: merge ip rule flush and list, save together

2016-09-22 Thread Hangbin Liu
iprule_flush() and iprule_list_or_save() both call function rtnl_wilddump_request() and rtnl_dump_filter(). So merge them together just like other files do. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iprule.c | 121 +++--

[PATCH iproute2 2/2] ip rule: add selector support

2016-09-22 Thread Hangbin Liu
Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/iprule.c| 180 +++-- man/man8/ip-rule.8 | 6 +- 2 files changed, 180 insertions(+), 6 deletions(-) diff --git a/ip/iprule.c b/ip/iprule.c index e18505f..42fb6af 100644 --

[PATCH iproute2 0/2] ip rule: merger iprule_flush and add selector support

2016-09-22 Thread Hangbin Liu
When merge iprule_flush() and iprule_list_or_save(). Renamed rtnl_filter_t filter to filter_fn because we want to use global variable 'filter' to filter nlmsg in the next patch. Hangbin Liu (2): ip rule: merge ip rule flush and list, save together ip rule: add selector support ip/iprule.c

[PATCH iproute2] misc/ss: tcp cwnd should be unsigned

2016-09-22 Thread Hangbin Liu
tcp->snd_cwd is a u32, but ss treats it like a signed int. This may results in negative bandwidth calculations. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- misc/ss.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index 3b268d9

[PATCHv2 net] igmp: do not remove igmp souce list info when set link down

2016-11-08 Thread Hangbin Liu
() in ip_mc_destroy_dev(). On the other hand, we should restore back instead of free all source filter info in igmpv3_del_delrec(). Or we will not able to restore IGMPv3 source filter info after NETDEV_UP and NETDEV_POST_TYPE_CHANGE. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ne

[PATCH net-next] igmp: Document sysctl force_igmp_version

2016-11-06 Thread Hangbin Liu
There is some difference between force_igmp_version and force_mld_version. Add document to make users aware of this. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- Documentation/networking/ip-sysctl.txt | 15 +++ 1 file changed, 15 insertions(+) diff --git a/Documen

[PATCH net] igmp: do not remove igmp souce list info when set link down

2016-11-06 Thread Hangbin Liu
() in ip_mc_destroy_dev(). On the other hand, we should restore back instead of free all source filter info in igmpv3_del_delrec(). Or we will not able to restore IGMPv3 source filter info after NETDEV_UP and NETDEV_POST_TYPE_CHANGE. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ne

[PATCHv3 net] igmp: do not remove igmp souce list info when set link down

2016-11-14 Thread Hangbin Liu
lear_src() only when ...") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- net/ipv4/igmp.c | 50 -- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 606cc3e..15db786 100644 --- a

Re: [PATCH] igmp: Make igmp group member RFC 3376 compliant

2016-11-15 Thread Hangbin Liu
Hi David, On Tue, Nov 08, 2016 at 10:26:25AM +0100, Michal Tesar wrote: > On Mon, Nov 07, 2016 at 08:13:45PM -0500, David Miller wrote: > > > From: Michal Tesar > > Date: Thu, 3 Nov 2016 10:38:34 +0100 > > > > > 2. If the received Query is a General Query, the interface

[PATCH net-next] bridge: add igmpv3 and mldv2 query support

2016-11-17 Thread Hangbin Liu
Add bridge IGMPv3 and MLDv2 query support. But before we think it is stable enough, only enable it when declare in force_igmp/mld_version. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- net/bridge/br_multicast.c | 203 -- 1 file change

Re: [PATCH net-next] bridge: add igmpv3 and mldv2 query support

2016-11-20 Thread Hangbin Liu
2016-11-18 18:31 GMT+08:00 Nikolay Aleksandrov : > On 18/11/16 11:09, Nikolay Aleksandrov wrote: >> >> On 18/11/16 11:04, Nikolay Aleksandrov wrote: >>> >>> (+CC Roopa) >>> Hi Hangbin, >>> This patch is not correct, you should not use the net device IGMP config >>> in

[PATCH net] mld: do not remove mld souce list info when set link down

2017-01-12 Thread Hangbin Liu
info when set link down. Remove igmp6_group_dropped() in ipv6_mc_destroy_dev() since we have called it in ipv6_mc_down(). Also clear all source info after igmp6_group_dropped() instead of in it because ipv6_mc_down() will call igmp6_group_dropped(). Signed-off-by: Hangbin Liu <liuhang...@gmail.

Re: [PATCHv2 net-next 0/4] update ipvs sysctl document

2017-03-14 Thread Hangbin Liu
2017-03-13 17:14 GMT+08:00 Simon Horman <ho...@verge.net.au>: >> > >> > Hangbin Liu (4): >> > ipvs: fix sync_threshold description and add sync_refresh_period, >> > sync_retries >> > ipvs: Document sysctl sync_qlen_max and sync_sock_size

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-28 Thread Hangbin Liu
On Thu, Jul 27, 2017 at 09:56:08PM -0700, Cong Wang wrote: > On Wed, Jul 26, 2017 at 11:49 AM, David Ahern wrote: > > On 7/26/17 12:27 PM, Roopa Prabhu wrote: > >> agreed...so looks like the check in v3 should be > >> > >> > >> + if ( rt == net->ipv6.ip6_null_entry || >

[PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-20 Thread Hangbin Liu
..") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- net/ipv6/route.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 4d30c96..8fc52de 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3637,12 +3637,6 @@ static int inet6_rtm_getro

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-20 Thread Hangbin Liu
Hi Roopa, Cong, 2017-07-20 22:51 GMT+08:00 Hangbin Liu <liuhang...@gmail.com>: > After commit 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib > result when requested"). When we get a prohibit ertry, we will return > -EACCES directly. > > Before: > + ip

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-20 Thread Hangbin Liu
2017-07-20 23:06 GMT+08:00 Hangbin Liu <liuhang...@gmail.com>: >> +++ b/net/ipv6/route.c >> @@ -3637,12 +3637,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, >> struct nlmsghdr *nlh, >> dst = ip6_route_lookup(net, , 0); >> >

[PATCHv2 net] ipv6: should not return rt->dst.error if it is prohibit or blk hole entry.

2017-07-20 Thread Hangbin Liu
"net: ipv6: RTM_GETROUTE: return matched fib...") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- net/ipv6/route.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 4d30c96..c290aa4 100644 --- a/net/ipv6/rout

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-23 Thread Hangbin Liu
Hi Cong, On Fri, Jul 21, 2017 at 11:42:46AM -0700, Cong Wang wrote: > On Thu, Jul 20, 2017 at 8:23 AM, Hangbin Liu <liuhang...@gmail.com> wrote: > > 2017-07-20 23:06 GMT+08:00 Hangbin Liu <liuhang...@gmail.com>: > >>> +++ b/net/ipv6/route.c > &

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-23 Thread Hangbin Liu
Hi Roopa, On Sat, Jul 22, 2017 at 09:55:51PM -0700, Roopa Prabhu wrote: > On Thu, Jul 20, 2017 at 7:51 AM, Hangbin Liu <liuhang...@gmail.com> wrote: > > After commit 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib > > result when requested"). When we get a

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-24 Thread Hangbin Liu
On Mon, Jul 24, 2017 at 12:57:43PM -0700, Cong Wang wrote: > On Sun, Jul 23, 2017 at 8:09 PM, Hangbin Liu <liuhang...@gmail.com> wrote: > > Do we still need this net->ipv6.ip6_null_entry check? How about remove all > > the checks? > > I believe you only need to ch

[PATCH iproute2] utils: also check AF_INET family when rtm_type is RTN_MULTICAST

2017-07-27 Thread Hangbin Liu
multicast ac6f:101:800:400:400:0:3c00:0 dev em1 scope link After fix: + ip route list type multicast table main multicast 172.111.1.1 dev em1 scope link Fixes: 56e3eb4c3400 ("ip: route: fix multicast route dumps") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- lib/utils.c

[PATCHv2 iproute2] utils: return default family when rtm_family is not RTNL_FAMILY_IPMR/IP6MR

2017-07-27 Thread Hangbin Liu
multicast ac6f:101:800:400:400:0:3c00:0 dev em1 scope link After fix: + ip route list type multicast table main multicast 172.111.1.1 dev em1 scope link Fixes: 56e3eb4c3400 ("ip: route: fix multicast route dumps") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- lib/utils.c

Re: [PATCHv3 net] ipv6: no need to return rt->dst.error if it is prohibit entry

2017-07-27 Thread Hangbin Liu
On Wed, Jul 26, 2017 at 11:09:39AM -0600, David Ahern wrote: > On 7/26/17 3:20 AM, Hangbin Liu wrote: > > After commit 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib > > result when requested"). When we get a prohibit ertry, we will return > > -EACCES dir

[PATCHv4 net] ipv6: no need to check rt->dst.error when get route info

2017-07-27 Thread Hangbin Liu
bit 2003::/64 dev lo metric 1024 error -13 pref medium \# ip -6 route add unreachable 2004::/64 dev eth1 \# ip -6 route get fibmatch 2004::1 unreachable 2004::/64 dev lo metric 1024 error -113 pref medium Fixes: 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib...") Signed-off-b

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-27 Thread Hangbin Liu
Hi David, On Wed, Jul 26, 2017 at 01:00:26PM -0600, David Ahern wrote: > >> I don't think so. If I add a prohibit route and use the fibmatch > >> attribute, I want to see the route from the FIB that was matched. > > > > > > yes, exactly. wouldn't 'rt != net->ipv6.ip6_prohibit_entry' above let

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-26 Thread Hangbin Liu
On Tue, Jul 25, 2017 at 10:49:05AM -0700, Cong Wang wrote: > On Mon, Jul 24, 2017 at 5:08 PM, Hangbin Liu <liuhang...@gmail.com> wrote: > > But what we want in inet6_rtm_getroute() and rt6_dump_route() is to > > get/dump the route info. So we should get the info

[PATCHv3 net] ipv6: no need to return rt->dst.error if it is prohibit entry

2017-07-26 Thread Hangbin Liu
a2a1 ("ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf") We will init rt6i_idev correctly. So we could dump ip6_null_entry (unreachable route entry) safely now. Fixes: 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib...") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --

Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-25 Thread Hangbin Liu
On Mon, Jul 24, 2017 at 09:28:07PM -0600, David Ahern wrote: > On 7/24/17 6:08 PM, Hangbin Liu wrote: > > That's why I think we should remove both rt->dst.error and ip6_null_entry > > check in inet6_rtm_getroute(). And even further, remove the ip6_null_entry > > check in rt

Re: [PATCH net] ip6_tunnel: remove unreachable ICMP_REDIRECT code

2017-05-08 Thread Hangbin Liu
2017-05-09 3:59 GMT+08:00 David Miller <da...@davemloft.net>: > From: Hangbin Liu <liuhang...@gmail.com> > Date: Mon, 8 May 2017 19:11:03 +0800 > >> After call ip6_tnl_err(), the rel_type will be ether ICMPV6_DEST_UNREACH >> or ICMPV6_PKT_TOOBIG. We will nev

Re: [PATCH net] ipv6: make sure dev is not NULL before call ip6_frag_reasm

2017-05-09 Thread Hangbin Liu
On Mon, May 08, 2017 at 07:50:30AM -0700, Eric Dumazet wrote: > On Mon, 2017-05-08 at 11:09 +0800, Hangbin Liu wrote: > > Since ip6_frag_reasm() will call __in6_dev_get(dev), which will access > > dev->ip6_ptr. We need to make sure dev is not NULL. > > > > Signe

Re: [PATCH net] tcp: init tcp_options before using it.

2017-05-09 Thread Hangbin Liu
On Mon, May 08, 2017 at 07:49:23AM -0700, Eric Dumazet wrote: > On Mon, 2017-05-08 at 17:57 +0800, Hangbin Liu wrote: > > I searched 4308fc58dced ("tcp: Document use of undefined variable") in > > archive list, but did not find the thread. So I'm not sure why we only >

Re: [PATCH net] ip6_tunnel: remove unreachable ICMP_REDIRECT code

2017-05-09 Thread Hangbin Liu
On Mon, May 08, 2017 at 01:26:48PM -0700, Cong Wang wrote: > On Mon, May 8, 2017 at 4:11 AM, Hangbin Liu <liuhang...@gmail.com> wrote: > > After call ip6_tnl_err(), the rel_type will be ether ICMPV6_DEST_UNREACH > > or ICMPV6_PKT_TOOBIG. We will never reach ICM

Re: [PATCH net] net/flow: fix fc->percpu NULL pointer dereference

2017-06-09 Thread Hangbin Liu
2017-06-09 16:43 GMT+08:00 Xin Long <lucien@gmail.com>: > On Fri, Jun 9, 2017 at 4:32 PM, Steffen Klassert > <steffen.klass...@secunet.com> wrote: >> On Fri, Jun 09, 2017 at 04:23:01PM +0800, Hangbin Liu wrote: >>> Hi Steffen, >>> >>> BTW,

[PATCH net] net/flow: fix fc->percpu NULL pointer dereference

2017-06-09 Thread Hangbin Liu
reproduce, just add ipsec in netns and then remove the netns. Fixes: 35db06912189 ("xfrm: do the garbage collection after flushing policy") Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- net/core/flow.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --g

Re: [PATCH net] net/flow: fix fc->percpu NULL pointer dereference

2017-06-09 Thread Hangbin Liu
eck in flow_cache_percpu_empty() or in xfrm_policy_flush(). Do you have any suggestion? Thanks Hangbin 2017-06-09 16:13 GMT+08:00 Hangbin Liu <liuhang...@gmail.com>: > Now we will force to do garbage collection if any policy removed in > xfrm_policy_flush(). But during xfrm_net_exit(). We call

Re: [PATCH net-next v2] bridge: fix hello and hold timers starting/stopping

2017-05-20 Thread Hangbin Liu
On Sat, May 20, 2017 at 09:06:16AM +0200, Ivan Vecera wrote: > 2017-05-20 7:57 GMT+02:00 Hangbin Liu <liuhang...@gmail.com>: > > On Fri, May 19, 2017 at 07:30:43PM +0200, Ivan Vecera wrote: > >> Current bridge code incorrectly handles starting/stopping of hello and >

Re: [PATCH net-next v2] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Hangbin Liu
On Fri, May 19, 2017 at 07:30:43PM +0200, Ivan Vecera wrote: > Current bridge code incorrectly handles starting/stopping of hello and > hold timers during STP enable/disable. > > 1. Timers are stopped in br_stp_start() during NO_STP->USER_STP >transition. The timers are already stopped in

[PATCH] xfrm: fix xfrm_dev_event() missing when compile without CONFIG_XFRM_OFFLOAD

2017-05-31 Thread Hangbin Liu
with IPsec on it. there will no xfrm_garbage_collect(), which will cause dev usage count hold and get error like: unregister_netdevice: waiting for to become free. Usage count = 4 Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Hangbin Liu <liuhang...@g

[PATCH iproute2 net-next] ip neigh: allow flush FAILED neighbour entry

2017-06-05 Thread Hangbin Liu
D entry. Signed-off-by: Hangbin Liu <liuhang...@gmail.com> --- ip/ipneigh.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ip/ipneigh.c b/ip/ipneigh.c index 4d8fc85..8082fa8 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -445,7 +445,6 @@ static int do_show_or_flush(int arg

  1   2   3   >