tipc: Fix bug in topology server byte swapping routine
[safe/jmp/linux-2.6] / net / tipc / msg.h
index 5cf76a4..ad487e8 100644 (file)
@@ -70,7 +70,8 @@ static inline void msg_set_bits(struct tipc_msg *m, u32 w,
                                u32 pos, u32 mask, u32 val)
 {
        val = (val & mask) << pos;
-       m->hdr[w] &= ~htonl(mask << pos);
+       mask = mask << pos;
+       m->hdr[w] &= ~htonl(mask);
        m->hdr[w] |= htonl(val);
 }
 
@@ -85,7 +86,7 @@ static inline u32 msg_version(struct tipc_msg *m)
 
 static inline void msg_set_version(struct tipc_msg *m)
 {
-       msg_set_bits(m, 0, 29, 0xf, TIPC_VERSION);
+       msg_set_bits(m, 0, 29, 7, TIPC_VERSION);
 }
 
 static inline u32 msg_user(struct tipc_msg *m)