Permalink
Browse files

bpf: unmatched ioctls return {error, not_supported}

  • Loading branch information...
1 parent 1a79ec8 commit 9d51ae96181ea3acd5c8a406f5cd45d8bbf7c0a2 @msantos committed Apr 21, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/bpf.erl
View
@@ -149,7 +149,10 @@ ctl(Socket, version) ->
{Major, Minor};
Error ->
Error
- end.
+ end;
+
+ctl(_Socket, _Request) ->
+ {error, not_supported}.
%%
%% Set bpf attributes
@@ -199,11 +202,14 @@ ctl(Socket, setif, Ifname) ->
Ifname, <<0:((15*8) - (length(Ifname)*8)), 0:8>>,
<<0:(16*8)>>
]),
- procket:ioctl(Socket, ?BIOCSETIF, Ifreq).
+ procket:ioctl(Socket, ?BIOCSETIF, Ifreq);
% struct timeval
%ctl(Socket, timeout, Timeout) ->
-% procket:ioctl(Socket, ?BIOCSRTIMEOUT, <<0:(sizeof(timeval))/bytes>>).
+% procket:ioctl(Socket, ?BIOCSRTIMEOUT, <<0:(sizeof(timeval))/bytes>>);
+
+ctl(_Socket, _Request, _Arg) ->
+ {error, not_supported}.
bool(true) -> <<1:32/native>>;

0 comments on commit 9d51ae9

Please sign in to comment.