Skip to content

Commit

Permalink
pcap can't return the ethernet CRC trailer.
Browse files Browse the repository at this point in the history
  • Loading branch information
msantos committed Jan 7, 2010
1 parent df9bbc1 commit ec0ca16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/epcap_net.erl
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ proto(?IPPROTO_ICMP) -> icmp;
proto(?IPPROTO_TCP) -> tcp;
proto(?IPPROTO_UDP) -> udp.

ether(<<Dhost:6/bytes, Shost:6/bytes, Type:2/bytes, Packet/binary>>) ->
Len = byte_size(Packet) - 4,
<<Payload:Len/bytes, CRC:4/bytes>> = Packet,
ether(<<Dhost:6/bytes, Shost:6/bytes, Type:2/bytes, Payload/binary>>) ->
% Len = byte_size(Packet) - 4,
% <<Payload:Len/bytes, CRC:4/bytes>> = Packet,
{#ether{
dhost = Dhost, shost = Shost,
type = Type, crc = CRC
type = Type
}, Payload}.

ipv4(
Expand Down

0 comments on commit ec0ca16

Please sign in to comment.