diff mbox series

[2/7] monitor: Mask flags from attribute identifier

Message ID 20240805140721.57518-2-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [1/7] monitor: Decode RMNet Mux Identifier | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

Denis Kenzior Aug. 5, 2024, 2:07 p.m. UTC
Certain flags (for example, NLA_F_NESTED) are ORed with the netlink
attribute type identifier prior to being sent on the wire.  Such flags
need to be masked off and not taken into consideration when attribute
type is being compared against known values.
---
 monitor/nlmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/monitor/nlmon.c b/monitor/nlmon.c
index 941992595412..214246ea72c2 100644
--- a/monitor/nlmon.c
+++ b/monitor/nlmon.c
@@ -7762,7 +7762,7 @@  static void print_rtnl_attributes(int indent, const struct attr_entry *table,
 		return;
 
 	for (attr = rt_attr; RTA_OK(attr, len); attr = RTA_NEXT(attr, len)) {
-		uint16_t rta_type = attr->rta_type;
+		uint16_t rta_type = attr->rta_type & NLA_TYPE_MASK;
 		enum attr_type type = ATTR_UNSPEC;
 		attr_func_t function;
 		const struct attr_entry *nested;