projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofp-print: Print fragment handling in OpenFlow switch config messages.
[openvswitch]
/
lib
/
netlink.c
diff --git
a/lib/netlink.c
b/lib/netlink.c
index 3ed2f53a9e8c6a2b14e59e3ee2e6b0f30f430df8..f1234ad4840dad8db21f3899a65415314f9bd50c 100644
(file)
--- a/
lib/netlink.c
+++ b/
lib/netlink.c
@@
-358,6
+358,14
@@
nl_msg_next(struct ofpbuf *buffer, struct ofpbuf *msg)
\f
/* Attributes. */
\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)
/* 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)",
if (aligned_len > (char*)tail - (char*)p) {
VLOG_DBG_RL(&rl, "%zu: attr %"PRIu16" aligned data len (%zu) "
"> bytes left (%tu)",
- offset, nl
a->nla_type
, aligned_len,
+ offset, nl
_attr_type(nla)
, aligned_len,
(char*)tail - (char*)p);
return false;
}
(char*)tail - (char*)p);
return false;
}
- type = nl
a->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;
if (type < n_attrs && policy[type].type != NL_A_NO_ATTR) {
const struct nl_policy *e = &policy[type];
size_t min_len, max_len;