Skip to contentSkip to conversation

rstp: Fix compiler type-punning error in rstp daemon

PATCH New Neil Horman 1 participant 1 message Mar 3, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rstp: Fix compiler type-punning error in rstp daemon

Hey-
Was trying to build the rstp daemon today and got a type-punning error
in bridge_track.c. This patch fixes it up.

 bridge_track.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bridge_track.c +1 -1
index be555de..fa59732 100644
@@ -599,7 +599,7 @@ void bridge_bpdu_rcv(int if_index, const unsigned char *data, int len)
 		//    TST(ntohs(*(uint16_t*)bpdu.body.message_age)
 		//        < ntohs(*(uint16_t*)bpdu.body.max_age), );
 		TST(memcmp(bpdu->body.bridge_id, &ifc->master->bridge_id, 8) != 0
-		    || (ntohs(*(uint16_t *) bpdu->body.port_id) & 0xfff) !=
+		    || (ntohs((uint16_t) *bpdu->body.port_id) & 0xfff) !=
 		    ifc->port_index,);
 		break;
 	case BPDU_TOPO_CHANGE_TYPE: