Révision 8135339c
Ajouté par Ermal il y a presque 10 ans
pfPorts/filterlog/files/filterlog.c | ||
---|---|---|
90 | 90 |
decode_packet(u_char *user __unused, const struct pcap_pkthdr *pkthdr, const u_char *packet) |
91 | 91 |
{ |
92 | 92 |
const struct pfloghdr *hdr; |
93 |
struct ip *ip; |
|
93 |
const struct ip *ip;
|
|
94 | 94 |
u_int length = pkthdr->len; |
95 | 95 |
u_int hdrlen; |
96 | 96 |
u_int caplen = pkthdr->caplen; |
... | ... | |
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
#define MIN_PFLOG_HDRLEN 45 |
106 |
hdr = (struct pfloghdr *)packet; |
|
106 |
hdr = (const struct pfloghdr *)packet;
|
|
107 | 107 |
if (hdr->length < MIN_PFLOG_HDRLEN) { |
108 | 108 |
sbuf_printf(&sbuf, "[pflog: invalid header length!]"); |
109 | 109 |
goto printsbuf; |
... | ... | |
130 | 130 |
/* skip to the real packet */ |
131 | 131 |
length -= hdrlen; |
132 | 132 |
packet += hdrlen; |
133 |
ip = (struct ip *)packet; |
|
133 |
ip = (const const struct ip *)packet;
|
|
134 | 134 |
|
135 | 135 |
if (length < 4) { |
136 | 136 |
sbuf_printf(&sbuf, "%d, IP(truncated-ip %d) ", IP_V(ip), length); |
Formats disponibles : Unified diff
Add print icmp as part of Ticket #3663 and also avoid warnings during build