Remove bitfield access.

It improves portability.
This commit is contained in:
Taeho Oh 2016-01-24 00:36:44 +09:00
parent 6641bb8424
commit 94cc364903

View File

@ -48,15 +48,7 @@ typedef struct _OMVSEthHdr {
} __attribute__((packed)) OMVSEthHdr;
typedef struct _OMVSIPHdr {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
guint ihl:4;
guint version:4;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
guint version:4;
guint ihl:4;
#else
#error "endian error"
#endif
guint8 vhl;
guint8 tos;
guint16 tot_len;
guint16 id;
@ -258,7 +250,7 @@ static gpointer _omvs_start_scan_job(gpointer data) {
}
ip = (OMVSIPHdr *)packet;
ip_hdr_len = ip->ihl * 4;
ip_hdr_len = (ip->vhl & 0x0f) * 4;
if (caplen < ip_hdr_len) {
continue;
}