Skip to contentSkip to conversation

mptcp: Allow ip mptcp endpoint show

PATCH In review Christoph Paasch 3 participants 4 messages Aug 3, 2020 Networking MPTCP

lore
Share & tools
lore

Christoph Paasch

author
#0 lore raw

PATCH 1/1 mptcp: Allow ip mptcp endpoint show

The intention was to dump the entire address-list when no ID is given. However, the condition needs to rather check on argc as argv will always be != NULL.

Fixes 7e0767cd862b ("add support for mptcp netlink interface")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>
---
 ip/ipmptcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipmptcp.c +1 -1
index bc12418bd39c..df38754c82b6 100644
@@ -273,7 +273,7 @@ static int mptcp_addr_show(int argc, char **argv)
 	struct nlmsghdr *answer;
 	int ret;
 
-	if (!argv)
+	if (argc == 0)
 		return mptcp_addr_dump();
 
 	ret = mptcp_parse_opt(argc, argv, &req.n, false);
Signature · 1 line
2.23.0
#1 lore raw
Quoted 15 lines · Christoph Paasch

The intention was to dump the entire address-list when no ID is given. However, the condition needs to rather check on argc as argv will always be != NULL.

Fixes 7e0767cd862b ("add support for mptcp netlink interface")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>
---
 ip/ipmptcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipmptcp.c +0 -0
index bc12418bd39c..df38754c82b6 100644

ip/ipmptcp.c static int mptcp_addr_show(int argc, char **argv) · line 279

Quoted 8 lines
ip/ipmptcp.c +1 -1
@@ -273,7 +273,7 @@ static int mptcp_addr_show(int argc, char **argv)
 	struct nlmsghdr *answer;
 	int ret;
 
-	if (!argv)
+	if (argc == 0)
 		return mptcp_addr_dump();
 
 	ret = mptcp_parse_opt(argc, argv, &req.n, false);

I think I saw already this patch :-)

https://lore.kernel.org/netdev/20200724121718.2180511-1-matthieu.baerts(a)tessares.net

Signature · 1 line
davide
author
#2 lore raw
Quoted 19 lines · Davide Caratti
Quoted 18 lines · Christoph Paasch

The intention was to dump the entire address-list when no ID is given. However, the condition needs to rather check on argc as argv will always be != NULL.

Fixes 7e0767cd862b ("add support for mptcp netlink interface")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>
---
 ip/ipmptcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipmptcp.c +0 -0
index bc12418bd39c..df38754c82b6 100644
@@ -273,7 +273,7 @@ static int mptcp_addr_show(int argc, char **argv)
 	struct nlmsghdr *answer;
 	int ret;
 
Quoted 7 lines

ip/ipmptcp.c static int mptcp_addr_show(int argc, char **argv) · line 279

Quoted 5 lines
ip/ipmptcp.c +1 -1
-	if (!argv)
+	if (argc == 0)
 		return mptcp_addr_dump();
 
 	ret = mptcp_parse_opt(argc, argv, &req.n, false);

I think I saw already this patch :-)

Interesting, I was on origin/master and not origin/main ... well, well... :-)

Christoph

Quoted 6 lines

https://lore.kernel.org/netdev/20200724121718.2180511-1-matthieu.baerts(a)tessares.net

Signature · 1 line
davide
#3 lore raw

Hi Christoph,

Quoted 24 lines · Christoph Paasch
Quoted 23 lines · Davide Caratti
Quoted 22 lines · Christoph Paasch

The intention was to dump the entire address-list when no ID is given. However, the condition needs to rather check on argc as argv will always be != NULL.

Fixes 7e0767cd862b ("add support for mptcp netlink interface")
Signed-off-by Christoph Paasch <cpaasch(a)apple.com>
---
  ip/ipmptcp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipmptcp.c +1 -1
index bc12418bd39c..df38754c82b6 100644
@@ -273,7 +273,7 @@ static int mptcp_addr_show(int argc, char **argv)
  	struct nlmsghdr *answer;
  	int ret;
 
-	if (!argv)
+	if (argc == 0)
  		return mptcp_addr_dump();
 
Quoted 5 lines
Quoted 3 lines

ip/ipmptcp.c static int mptcp_addr_show(int argc, char **argv) · line 279

Quoted 1 line
ip/ipmptcp.c +0 -0
  	ret = mptcp_parse_opt(argc, argv, &req.n, false);

I think I saw already this patch :-)

Interesting, I was on origin/master and not origin/main ... well, well... :-)

Yeah, I didn't see that directly as well!
I am not sure it is a good idea to switch to a new default branch while still leaving "master" alive without any dedicated commit :)

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net