From e6ddf6d5424c3914dbaa9801244ddb24c03b7917 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Fri, 10 May 2013 14:58:24 +0200 Subject: pcap_io: minor: fix some quirks We can just replace int with uin32_t, that's no problem. Also fix one case where we moved to uint16_t. Signed-off-by: Daniel Borkmann --- pcap_io.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcap_io.h b/pcap_io.h index 09d89fb..a491f39 100644 --- a/pcap_io.h +++ b/pcap_io.h @@ -72,7 +72,7 @@ struct pcap_pkthdr_kuz { struct pcap_timeval ts; uint32_t caplen; uint32_t len; - int ifindex; + uint32_t ifindex; uint16_t protocol; uint8_t pkttype; }; @@ -323,7 +323,7 @@ static inline void tpacket_hdr_to_pcap_pkthdr(struct tpacket2_hdr *thdr, phdr->ppk.ts.tv_usec = ___constant_swab32(thdr->tp_nsec / 1000); phdr->ppk.caplen = ___constant_swab32(thdr->tp_snaplen); phdr->ppk.len = ___constant_swab32(thdr->tp_len); - phdr->ppk.ifindex = ___constant_swab32((u32) sll->sll_ifindex); + phdr->ppk.ifindex = ___constant_swab32(sll->sll_ifindex); phdr->ppk.protocol = ___constant_swab16(sll->sll_protocol); phdr->ppk.pkttype = sll->sll_pkttype; break; @@ -346,7 +346,7 @@ static inline void tpacket_hdr_to_pcap_pkthdr(struct tpacket2_hdr *thdr, phdr->ppb.caplen = ___constant_swab32(thdr->tp_snaplen); phdr->ppb.len = ___constant_swab32(thdr->tp_len); phdr->ppb.tsource = ___constant_swab16(tp_to_pcap_tsource(thdr->tp_status)); - phdr->ppb.ifindex = ___constant_swab16((u32) sll->sll_ifindex); + phdr->ppb.ifindex = ___constant_swab16((u16) sll->sll_ifindex); phdr->ppb.protocol = ___constant_swab16(sll->sll_protocol); phdr->ppb.hatype = sll->sll_hatype; phdr->ppb.pkttype = sll->sll_pkttype; -- cgit v1.2.3-54-g00ecf