[erlang-questions] Erlang filtering RARPs?

Kenji Rikitake kenji@REDACTED
Wed Jun 25 11:30:43 CEST 2014


It seems the default type of procket's packet:socket/0 is ETH_P_IP.
You can specify another protocol type in packet:socket/1.

See
https://github.com/msantos/procket/blob/master/src/packet.erl#L59
and
https://github.com/msantos/procket/blob/master/include/packet.hrl#L55

Kenji Rikitake

++> Kenji Rikitake <kenji@REDACTED> [2014-06-25 18:18:07 +0900]:
> Date: Wed, 25 Jun 2014 18:18:07 +0900
> From: Kenji Rikitake <kenji@REDACTED>
> To: Ken Hirata <khirata28@REDACTED>
> Cc: erlang-questions@REDACTED
> Subject: Re: [erlang-questions] Erlang filtering RARPs?
> 
> I'm not really familiar with Linux, but I guess it's not a procket issue
> but Linux kernel issue.
> 
> The packet(7) man entry in 
> http://linux.die.net/man/7/packet
> says you need to specify a link-level protocol
> when calling socket() as:
> 
>     packet_socket = socket(PF_PACKET, int socket_type, int protocol);
> 
> where the protocol number listed in <linux/if_ether.h> as:
> 
>     #define ETH_P_RARP      0x8035          /* Reverse Addr Res packet      */
> 
> You need to use ETH_P_ALL to check out all types of the packets.
> 
> See Erlang source file erts/emulator/drivers/common/inet_drv.c for the
> further details.  I've found no ETH_P_* stuff defined in OTP-17.0 source
> in GitHub.
> 
> Kenji Rikitake
> 
> ++> Ken Hirata <khirata28@REDACTED> [2014-06-23 19:31:36 -0700]:
> > Date: Mon, 23 Jun 2014 19:31:36 -0700
> > From: Ken Hirata <khirata28@REDACTED>
> > To: erlang-questions@REDACTED
> > Subject: [erlang-questions] Erlang filtering RARPs?
> > 
> > I can't seem to receive RARPs within an Erlang application using procket.
> > 
> > I can see RARPs on a tcpdump trace running within Ubuntu Linux when the
> > Erlang shell isn't executing.  RARPs are not recorded once I execute erl.
> > 
> > The RARPs contain the Ethernet source MAC address in the RARP Sender and
> > Target MAC address fields.
> > 
> > Does invoking Erlang initialize the OS network stack so that RARPs are
> > discarded?  If so, are there any configuration parameters to change the
> > behavior?
> > 
> > - Ken
> 
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list