mirror of
https://bitbucket.org/ohhara/ohmulticastvideoscanner.git
synced 2025-06-10 17:36:13 +00:00
Remove bitfield access.
It improves portability.
This commit is contained in:
parent
6641bb8424
commit
94cc364903
12
omvs_main.c
12
omvs_main.c
@ -48,15 +48,7 @@ typedef struct _OMVSEthHdr {
|
|||||||
} __attribute__((packed)) OMVSEthHdr;
|
} __attribute__((packed)) OMVSEthHdr;
|
||||||
|
|
||||||
typedef struct _OMVSIPHdr {
|
typedef struct _OMVSIPHdr {
|
||||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
guint8 vhl;
|
||||||
guint ihl:4;
|
|
||||||
guint version:4;
|
|
||||||
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
|
||||||
guint version:4;
|
|
||||||
guint ihl:4;
|
|
||||||
#else
|
|
||||||
#error "endian error"
|
|
||||||
#endif
|
|
||||||
guint8 tos;
|
guint8 tos;
|
||||||
guint16 tot_len;
|
guint16 tot_len;
|
||||||
guint16 id;
|
guint16 id;
|
||||||
@ -258,7 +250,7 @@ static gpointer _omvs_start_scan_job(gpointer data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ip = (OMVSIPHdr *)packet;
|
ip = (OMVSIPHdr *)packet;
|
||||||
ip_hdr_len = ip->ihl * 4;
|
ip_hdr_len = (ip->vhl & 0x0f) * 4;
|
||||||
if (caplen < ip_hdr_len) {
|
if (caplen < ip_hdr_len) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user