Skip to content

Commit

Permalink
rfc4861: encode: fix reserved field size
Browse files Browse the repository at this point in the history
Fix reserved field size when encoding packet:

https://tools.ietf.org/html/rfc4861#section-4.1

Reported in:

msantos#44

Thanks @alexshavelev!
  • Loading branch information
msantos committed Jul 26, 2017
1 parent df34e37 commit 6c54936
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pkt_icmp6.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (c) 2009-2015, Michael Santos <[email protected]>
%% Copyright (c) 2009-2017, Michael Santos <[email protected]>
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -96,7 +96,7 @@ codec(#icmp6{
<<Type:8, Code:8, Checksum:16, Id:16, Seq:16>>;

%%
%% RFC 4681: Neighbor Discovery for IP version 6 (IPv6)
%% RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
%%

% Router Solicitation Message
Expand All @@ -109,7 +109,7 @@ codec(#icmp6{
type = ?ND_ROUTER_SOLICIT, code = Code, checksum = Checksum,
res = Res
}) ->
<<?ND_ROUTER_SOLICIT:8, Code:8, Checksum:16, Res:16>>;
<<?ND_ROUTER_SOLICIT:8, Code:8, Checksum:16, Res:32>>;

% Router Advertisement Message
codec(<<?ND_ROUTER_ADVERT:8, Code:8, Checksum:16, Hop:8, M:1, O:1, Res:6,
Expand Down

0 comments on commit 6c54936

Please sign in to comment.