datapath: Don't use RCU for internal dev vport.
[openvswitch] / lib / netlink.c
index 3ed2f53a9e8c6a2b14e59e3ee2e6b0f30f430df8..f1234ad4840dad8db21f3899a65415314f9bd50c 100644 (file)
@@ -358,6 +358,14 @@ nl_msg_next(struct ofpbuf *buffer, struct ofpbuf *msg)
 \f
 /* Attributes. */
 
+/* Returns the bits of 'nla->nla_type' that are significant for determining its
+ * type. */
+int
+nl_attr_type(const struct nlattr *nla)
+{
+    return nla->nla_type & NLA_TYPE_MASK;
+}
+
 /* Returns the first byte in the payload of attribute 'nla'. */
 const void *
 nl_attr_get(const struct nlattr *nla)
@@ -539,12 +547,12 @@ nl_policy_parse(const struct ofpbuf *msg, size_t nla_offset,
         if (aligned_len > (char*)tail - (char*)p) {
             VLOG_DBG_RL(&rl, "%zu: attr %"PRIu16" aligned data len (%zu) "
                         "> bytes left (%tu)",
-                        offset, nla->nla_type, aligned_len,
+                        offset, nl_attr_type(nla), aligned_len,
                         (char*)tail - (char*)p);
             return false;
         }
 
-        type = nla->nla_type;
+        type = nl_attr_type(nla);
         if (type < n_attrs && policy[type].type != NL_A_NO_ATTR) {
             const struct nl_policy *e = &policy[type];
             size_t min_len, max_len;