Good point. Thanks for the explanation!

Emilio Escobar    / eescobar@gmail.com
- Great spirits have always encountered
  strong oppositions from mediocre minds. -- Einstein


On Wed, Nov 6, 2013 at 11:34 AM, koeppea <notifications@github.com> wrote:

> In include/ec_inet.h:
>
> > @@ -53,7 +53,11 @@ struct ip_addr {
> >     u_int16 addr_type;
> >     u_int16 addr_len;
> >     /* this must be aligned in memory */
> > -   u_int8 addr[MAX_IP_ADDR_LEN];
> > +   union {
> > +      u_int8 addr[MAX_IP_ADDR_LEN];
> > +      u_int16 addr16[MAX_IP_ADDR_LEN/2];
> > +      u_int32 addr32[MAX_IP_ADDR_LEN/4];
>
> The protocol handler don't need to be changed at all because the 8-bit
> variable type remains named as addr.
> The data stored in there (as already mentioned) is then automatically
> available to be used as different data types (e.g. a IPv4 address can be
> written as 4 bytes or 1 integer - in memory, it's exactly the same)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Ettercap/ettercap/pull/384/files#r7475174>
> .
>