avoid hton conversion on empty management msgs

Signed-off-by: Geoff Salmon <gsalmon@se-instruments.com>
master
Geoff Salmon 2013-02-11 17:49:17 -05:00 committed by Richard Cochran
parent c547145834
commit a299ca1e90
1 changed files with 2 additions and 1 deletions

3
tlv.c
View File

@ -269,7 +269,8 @@ void tlv_pre_send(struct TLV *tlv)
switch (tlv->type) {
case TLV_MANAGEMENT:
mgt = (struct management_tlv *) tlv;
mgt_pre_send(mgt);
if (tlv->length > sizeof(mgt->id))
mgt_pre_send(mgt);
mgt->id = htons(mgt->id);
break;
case TLV_MANAGEMENT_ERROR_STATUS: