Actions
Bug #1055
closedmaster-2013-12-02: source-pcap-file.c : line 65: u_int8_t undefined
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Affected Versions:
Effort:
Difficulty:
Label:
Description
The C99 types are uintX_t, not u_intX_t, see http://stackoverflow.com/questions/3103400/how-to-overcome-u-int8-t-vs-uint8-t-issue-efficiently for more background.
--- source-pcap-file.c.orig 2013-12-04 11:35:53.545719667 +1100
+++ source-pcap-file.c 2013-12-04 11:30:30.691176413 +1100
@@ -62,7 +62,7 @@
typedef struct PcapFileGlobalVars_ {
pcap_t *pcap_handle;
- int (*Decoder)(ThreadVars *, DecodeThreadVars *, Packet *, u_int8_t *, u_int16_t, PacketQueue *);
+ int (*Decoder)(ThreadVars *, DecodeThreadVars *, Packet *, uint8_t *, uint16_t, PacketQueue *);
int datalink;
struct bpf_program filter;
uint64_t cnt; /** packet counter */
And some more:
suricata-master/src root# grep u_int *
source-pfring.c: (u_int)GET_PKT_DIRECT_MAX_SIZE(p),
source-pfring.c: (u_int)GET_PKT_DIRECT_MAX_SIZE(p),
source-pfring.c: u_int32_t version = 0;
--- source-pfring.c.orig 2013-12-04 11:37:03.296352692 +1100
+++ source-pfring.c 2013-12-04 11:38:49.820513195 +1100
@@ -304,12 +304,12 @@
/* Depending on what compile time options are used for pfring we either return 0 or -1 on error and always 1 for success */
#ifdef HAVE_PFRING_RECV_UCHAR
int r = pfring_recv(ptv->pd, (u_char**)&GET_PKT_DIRECT_DATA(p),
- (u_int)GET_PKT_DIRECT_MAX_SIZE(p),
+ (uint32_t)GET_PKT_DIRECT_MAX_SIZE(p),
&hdr,
LIBPFRING_WAIT_FOR_INCOMING);
#else
int r = pfring_recv(ptv->pd, (char *)GET_PKT_DIRECT_DATA(p),
- (u_int)GET_PKT_DIRECT_MAX_SIZE(p),
+ (uint32_t)GET_PKT_DIRECT_MAX_SIZE(p),
&hdr,
LIBPFRING_WAIT_FOR_INCOMING);
#endif /* HAVE_PFRING_RECV_UCHAR */
@@ -358,7 +358,7 @@
*/
TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) {
int rc;
- u_int32_t version = 0;
+ uint32_t version = 0;
PfringIfaceConfig *pfconf = (PfringIfaceConfig *) initdata;
unsigned int opflag;
Actions