So I'm trying to use ether_aton()
which returns a struct ether_addr *
.
I'm trying to put this in my struct ether_header *eptr
(from net/ethernet.h) which has the ether_shost
member. I tried this:
struct ether_header *eptr; /* net/ethernet.h */
...
(struct ether_addr*)(eptr->ether_shost) = ether_aton(SRC_ETHER_ADDR);
This gives me the "Error: lvalue required as left operand of assignment"
I know I'm just not casting it correctly, but can't figure out how.
EDIT: Ended up getting it. Thanks for the help guys.
struct ether_addr* eth_addr = ether_aton(SRC_ETHER_ADDR);
int i;
for(i=0; i<6; i++)
eptr->ether_shost[i] = eth_addr->ether_addr_octet[i];
Just had to assign each of the octet individually.