Permalink
Browse files

Merge pull request #35 from GoelDeepak/fix-issue-34

fixes ifindex/2 to return correct interface index
  • Loading branch information...
2 parents 03f4d76 + 59e01bb commit ab8267282f418640a135a76226a79618d815e406 @msantos committed on GitHub May 10, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/packet.erl
View
@@ -156,7 +156,7 @@ iflist() ->
%% for packet:send/3.
%%-------------------------------------------------------------------------
ifindex(Socket, Dev) ->
- {ok, <<_Ifname:16/bytes, Ifr:8, _/binary>>} = procket:ioctl(Socket,
+ {ok, <<_Ifname:16/bytes, Ifr:32/native, _/binary>>} = procket:ioctl(Socket,
?SIOCGIFINDEX,
list_to_binary([
Dev, <<0:((15*8) - (length(Dev)*8)), 0:8, 0:128>>

0 comments on commit ab82672

Please sign in to comment.