[ovs-dev] [PATCH] meta-flow: Correctly byteswap skb_priority/skb_mark for mf_value.

Ben Pfaff blp at nicira.com
Tue Dec 18 23:54:32 UTC 2012


Fixes the following sparse warnings:

meta-flow.c:947:21: warning: incorrect type in assignment (different base types)
meta-flow.c:947:21:    expected restricted __be32 [usertype] be32
meta-flow.c:947:21:    got unsigned int const [unsigned] [usertype] skb_priority
meta-flow.c:951:21: warning: incorrect type in assignment (different base types)
meta-flow.c:951:21:    expected restricted __be32 [usertype] be32
meta-flow.c:951:21:    got unsigned int const [unsigned] [usertype] skb_mark

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/meta-flow.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index ebbd605..4579619 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -944,11 +944,11 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
         break;
 
     case MFF_SKB_PRIORITY:
-        value->be32 = flow->skb_priority;
+        value->be32 = htonl(flow->skb_priority);
         break;
 
     case MFF_SKB_MARK:
-        value->be32 = flow->skb_mark;
+        value->be32 = htonl(flow->skb_mark);
         break;
 
     CASE_MFF_REGS:
-- 
1.7.2.5




More information about the dev mailing list