link-mso19: Use more portable g_htons().

Not all systems provide <arpa/inet.h> and/or htons(). Use portable and
always available g_htons() from glib instead.
This commit is contained in:
Uwe Hermann 2013-01-08 03:12:01 +01:00
parent 753d722f34
commit a24e9d0484
1 changed files with 1 additions and 2 deletions

View File

@ -20,7 +20,6 @@
*/
#include "protocol.h"
#include <arpa/inet.h>
/* serial protocol */
#define mso_trans(a, v) \
@ -55,7 +54,7 @@ SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial,
p += sizeof(mso_head);
for (i = 0; i < n; i++) {
*(uint16_t *) p = htons(payload[i]);
*(uint16_t *) p = g_htons(payload[i]);
p += 2;
}
memcpy(p, mso_foot, sizeof(mso_foot));