diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-10 14:58:24 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-05-10 14:58:24 +0200 |
commit | e6ddf6d5424c3914dbaa9801244ddb24c03b7917 (patch) | |
tree | 9321fda954e8847a7061498790b6accead3ee7c5 | |
parent | 241f48d61375c1ac4413864f910dadf7fe492160 (diff) |
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 <dborkman@redhat.com>
-rw-r--r-- | pcap_io.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |