[lldp-devel] [PATCH 1/6] ecp22 fix version field extraction

Thomas Richter tmricht at linux.vnet.ibm.com
Tue Feb 5 16:24:56 UTC 2013


The inline function returned the wrong bits
of the field where the version number is stored..

Signed-off-by: Thomas Richter <tmricht at linux.vnet.ibm.com>
---
 include/lldp_ecp22.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/lldp_ecp22.h b/include/lldp_ecp22.h
index c80aca7..50a1b44 100644
--- a/include/lldp_ecp22.h
+++ b/include/lldp_ecp22.h
@@ -166,7 +166,7 @@ static inline void ecp22_hdr_set_version(struct ecp22_hdr *p, unsigned int ver)
 
 static inline unsigned int ecp22_hdr_read_version(struct ecp22_hdr *p)
 {
-	return p->ver_op_sub & 0x3ff;
+	return (p->ver_op_sub >> 12) & 0xf;
 }
 
 #endif
-- 
1.7.1



More information about the lldp-devel mailing list