Message ID | 20200803171010.4375-1-cpaasch@apple.com |
---|---|
State | Rejected, archived |
Headers | show |
Series | mptcp: Allow ip mptcp endpoint show | expand |
On Mon, 2020-08-03 at 10:10 -0700, Christoph Paasch wrote: > 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@apple.com> > --- > ip/ipmptcp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c > index bc12418bd39c..df38754c82b6 100644 > --- a/ip/ipmptcp.c > +++ b/ip/ipmptcp.c > @@ -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@tessares.net
On 08/03/20 - 19:23, Davide Caratti wrote: > On Mon, 2020-08-03 at 10:10 -0700, Christoph Paasch wrote: > > 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@apple.com> > > --- > > ip/ipmptcp.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c > > index bc12418bd39c..df38754c82b6 100644 > > --- a/ip/ipmptcp.c > > +++ b/ip/ipmptcp.c > > @@ -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 :-) Interesting, I was on origin/master and not origin/main ... well, well... :-) Christoph > > https://lore.kernel.org/netdev/20200724121718.2180511-1-matthieu.baerts@tessares.net > > -- > davide >
Hi Christoph, On 03/08/2020 19:38, Christoph Paasch wrote: > On 08/03/20 - 19:23, Davide Caratti wrote: >> On Mon, 2020-08-03 at 10:10 -0700, Christoph Paasch wrote: >>> 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@apple.com> >>> --- >>> ip/ipmptcp.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c >>> index bc12418bd39c..df38754c82b6 100644 >>> --- a/ip/ipmptcp.c >>> +++ b/ip/ipmptcp.c >>> @@ -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 :-) > > 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
diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c index bc12418bd39c..df38754c82b6 100644 --- a/ip/ipmptcp.c +++ b/ip/ipmptcp.c @@ -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);
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@apple.com> --- ip/ipmptcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)