Permalink
Browse files

Set source and encode on outgoing #eth frames.

  • Loading branch information...
1 parent 1c9d8e6 commit d1eb7c23e7f209b5b157acdb7d2afeb92625e54b @archaelus committed Mar 10, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/enet_eth_iface.erl
@@ -72,6 +72,13 @@ handle_call(Call, _From, State) ->
{noreply, State}.
%% @private
+handle_cast({send, #eth{src = Src} = Pkt}, S = #state{mac = Mac}) ->
+ PktSrc = case Src of
+ undefined -> Mac;
+ _ -> Src
+ end,
+ Frame = enet_codec:encode(eth, Pkt#eth{src = PktSrc}, []),
+ handle_cast({send, #raw{data=Frame}}, S);
handle_cast({send, #raw{data=Frame}}, S = #state{port=P})
when is_port(P), is_binary(Frame) ->
publish_tx(Frame, unknown, S),

0 comments on commit d1eb7c2

Please sign in to comment.