struct ether_addr
is already defined as a struct containing 6 bytes, so you
should replace
const struct ether_addr destAddr[6];
const struct ether_addr sourceAddr[6];
by
const struct ether_addr destAddr;
const struct ether_addr sourceAddr;
Note that you need an address-of operator &
when printing the EtherNet addresses:
printf("Dest MAC: %s\n", ether_ntoa(ð->destAddr));
printf("Source MAC: %s\n", ether_ntoa(ð->sourceAddr));
(What happened in your case that the destination address what put into destAddr[0]
,
the source address into destAddr[1]
and the protocol into the first byte of
destAddr[2]
.)