* [PATCH] netlink: Allow NLM_F_DUMP on netlink requests
@ 2014-09-24 9:13 Patrik Flykt
2014-09-24 15:27 ` Denis Kenzior
0 siblings, 1 reply; 3+ messages in thread
From: Patrik Flykt @ 2014-09-24 9:13 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 670 bytes --]
NLM_F_DUMP needs to be specified in cases where all existing network
interfaces are requested. As NLM_F_DUMP happens to be covered by the
current check for valid flags, update the check to allow the flag
being set by the caller.
---
ell/netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ell/netlink.c b/ell/netlink.c
index d247173..79a2a00 100644
--- a/ell/netlink.c
+++ b/ell/netlink.c
@@ -396,7 +396,7 @@ LIB_EXPORT unsigned int l_netlink_send(struct l_netlink *netlink,
!netlink->command_lookup)
return 0;
- if (flags & 0xff)
+ if (flags & 0xff & ~NLM_F_DUMP)
return 0;
if (function)
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] netlink: Allow NLM_F_DUMP on netlink requests
2014-09-24 9:13 [PATCH] netlink: Allow NLM_F_DUMP on netlink requests Patrik Flykt
@ 2014-09-24 15:27 ` Denis Kenzior
2014-09-26 10:13 ` Patrik Flykt
0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2014-09-24 15:27 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 863 bytes --]
Hi Patrik,
On 09/24/2014 04:13 AM, Patrik Flykt wrote:
> NLM_F_DUMP needs to be specified in cases where all existing network
> interfaces are requested. As NLM_F_DUMP happens to be covered by the
> current check for valid flags, update the check to allow the flag
> being set by the caller.
> ---
> ell/netlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ell/netlink.c b/ell/netlink.c
> index d247173..79a2a00 100644
> --- a/ell/netlink.c
> +++ b/ell/netlink.c
> @@ -396,7 +396,7 @@ LIB_EXPORT unsigned int l_netlink_send(struct l_netlink *netlink,
> !netlink->command_lookup)
> return 0;
>
> - if (flags & 0xff)
> + if (flags & 0xff & ~NLM_F_DUMP)
> return 0;
Maybe a nitpick, but should this be simply:
if (flags & ~NLM_F_DUMP)
?
>
> if (function)
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netlink: Allow NLM_F_DUMP on netlink requests
2014-09-24 15:27 ` Denis Kenzior
@ 2014-09-26 10:13 ` Patrik Flykt
0 siblings, 0 replies; 3+ messages in thread
From: Patrik Flykt @ 2014-09-26 10:13 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 456 bytes --]
On Wed, 2014-09-24 at 10:27 -0500, Denis Kenzior wrote:
> > - if (flags & 0xff)
> > + if (flags & 0xff & ~NLM_F_DUMP)
> > return 0;
>
> Maybe a nitpick, but should this be simply:
>
> if (flags & ~NLM_F_DUMP)
Oh, I misread netlink.h on this one!
NLM_F_DUMP has a value of 0x300 (and not 16, that's actually
NLM_F_DUMP_INTR) so it is not affected by the mask. Let's NACK this
patch instead.
Cheers,
Patrik
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-26 10:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 9:13 [PATCH] netlink: Allow NLM_F_DUMP on netlink requests Patrik Flykt
2014-09-24 15:27 ` Denis Kenzior
2014-09-26 10:13 ` Patrik Flykt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.