chiark / gitweb /
sd-rtnl: message - don't skip parts of message when parsing
authorTom Gundersen <teg@jklm.no>
Sun, 23 Mar 2014 16:51:20 +0000 (17:51 +0100)
committerTom Gundersen <teg@jklm.no>
Sun, 23 Mar 2014 16:51:23 +0000 (17:51 +0100)
If a message type occurs repeatedly let the last one win.

Also, don't skip type == MAX.

Based on patch from: Susant Sahani <susant@redhat.com>

src/libsystemd/sd-rtnl/rtnl-message.c

index e243c7b..56fb68f 100644 (file)
@@ -1016,7 +1016,7 @@ int rtnl_message_parse(sd_rtnl_message *m,
         for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) {
                 type = rta->rta_type;
 
-                if (type < max && !tb[type])
+                if (type <= max)
                         tb[type] = (uint8_t *) rta - (uint8_t *) m->hdr;
         }