Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[firefly-linux-kernel-4.4.55.git] / net / tipc / msg.h
index 5cf76a4f28e43903bb68abd25afc8d893df2ef6d..ad487e8abcc2f2f0bcada4432db6c25e8dbf0dee 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)