Im not sure if you need more code but
Code:
struct Ethfrm_t
{
struct FCfrm_t* ptr;
unsigned char DestEthAdr[6];
unsigned char SrcEthAdr[6];
UINT32 VLAN_HdrSave;
//unsigned char reserved[4];
void* buffer;
} __attribute__ ((packed));
Ethfrm_t* Ethfrm;
Ethfrm = malloc(sizeof(Ethfrm));
Ethfrm->buffer = (void*)malloc(BUF_SIZE); /*Buffer for Ethernet Frame*/
length = recvfrom(s, Ethfrm->buffer, BUF_SIZE, 0, NULL, NULL);
if (length == -1) {
perror("recvfrom():");
exit(1);
}
This works but when i uncomment the unsigned char reserved i get the BAD ADDRESS error after like 2 seconds of the server running Im not really sure what that means or how to fix it?