mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
nwfilter: assure virNWFilterSnoop(Eth|Dhcp)Hdr structs don't change size
These two objects are used to access fields in actual ethernet packets captures with libpcap, so it's essential that they don't change size for any reason. This patch uses gnulib's verify() macro to make sure their sizes don't change. Signed-off-by: Laine Stump <laine@laine.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
75f4813c7d
commit
f565321b26
@ -195,6 +195,7 @@ struct _virNWFilterSnoopEthHdr {
|
|||||||
uint16_t eh_type;
|
uint16_t eh_type;
|
||||||
uint8_t eh_data[];
|
uint8_t eh_data[];
|
||||||
} ATTRIBUTE_PACKED;
|
} ATTRIBUTE_PACKED;
|
||||||
|
verify(sizeof(struct _virNWFilterSnoopEthHdr) == 14);
|
||||||
|
|
||||||
typedef struct _virNWFilterSnoopDHCPHdr virNWFilterSnoopDHCPHdr;
|
typedef struct _virNWFilterSnoopDHCPHdr virNWFilterSnoopDHCPHdr;
|
||||||
typedef virNWFilterSnoopDHCPHdr *virNWFilterSnoopDHCPHdrPtr;
|
typedef virNWFilterSnoopDHCPHdr *virNWFilterSnoopDHCPHdrPtr;
|
||||||
@ -216,6 +217,7 @@ struct _virNWFilterSnoopDHCPHdr {
|
|||||||
char d_file[128];
|
char d_file[128];
|
||||||
uint8_t d_opts[];
|
uint8_t d_opts[];
|
||||||
} ATTRIBUTE_PACKED;
|
} ATTRIBUTE_PACKED;
|
||||||
|
verify(sizeof(struct _virNWFilterSnoopDHCPHdr) == 236);
|
||||||
|
|
||||||
/* DHCP options */
|
/* DHCP options */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user