iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] monitor: put nortnl check into nlmon_print_rtnl
@ 2022-10-27 18:18 James Prestwood
  2022-10-27 19:03 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2022-10-27 18:18 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

Doing this allows --nortnl to work when reading pcaps.
---
 monitor/nlmon.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/monitor/nlmon.c b/monitor/nlmon.c
index d786cc33..9694cfd1 100644
--- a/monitor/nlmon.c
+++ b/monitor/nlmon.c
@@ -8089,6 +8089,9 @@ void nlmon_print_rtnl(struct nlmon *nlmon, const struct timeval *tv,
 	int64_t aligned_size = NLMSG_ALIGN(size);
 	const struct nlmsghdr *nlmsg;
 
+	if (nlmon->nortnl)
+		return;
+
 	update_time_offset(tv);
 
 	for (nlmsg = data; NLMSG_OK(nlmsg, aligned_size);
@@ -8207,9 +8210,7 @@ static bool nlmon_receive(struct l_io *io, void *user_data)
 		case NETLINK_ROUTE:
 			store_netlink(nlmon, tv, proto_type, nlmsg);
 
-			if (!nlmon->nortnl)
-				nlmon_print_rtnl(nlmon, tv, nlmsg,
-							nlmsg->nlmsg_len);
+			nlmon_print_rtnl(nlmon, tv, nlmsg, nlmsg->nlmsg_len);
 			break;
 		case NETLINK_GENERIC:
 			nlmon_message(nlmon, tv, tp, nlmsg);
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] monitor: put nortnl check into nlmon_print_rtnl
  2022-10-27 18:18 [PATCH] monitor: put nortnl check into nlmon_print_rtnl James Prestwood
@ 2022-10-27 19:03 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2022-10-27 19:03 UTC (permalink / raw)
  To: James Prestwood, iwd

Hi James,

On 10/27/22 13:18, James Prestwood wrote:
> Doing this allows --nortnl to work when reading pcaps.
> ---
>   monitor/nlmon.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 

Applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-27 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 18:18 [PATCH] monitor: put nortnl check into nlmon_print_rtnl James Prestwood
2022-10-27 19:03 ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).