I'm just confused to think of a simple method to do this but
Code:
while (1) {
length = recvfrom(s, buffer, BUF_SIZE, 0, NULL, NULL);
if (eh->h_proto == ETH_P_NULL && memcmp( (const void*)eh->h_dest, (const void*)src_mac, ETH_MAC_LEN) == 0 ) {
/* Comparing the Ethertype*/
if(memcmp((void*)(etherhead+14), FCoe,2) == 0 || memcmp((void*)(etherhead+14),FIP,2) == 0){
Ethfrm->ptr = (struct FCfrm_t *)(&Ethfrm->pad); // Ethfrm pointer
} else if(memcmp((void*)(etherhead+14), VLAN,2) == 0){
Ethfrm->ptr = (struct FCfrm_t *)(&Ethfrm->reserved);
printf("VLAN HEADER\n");
if((etherhead[16]& 0x10) == 0x10){
//printf("readint %02X \n",etherhead[16]);
printEthfrm(Ethfrm);
//break;
}
} else {
printEthfrm(Ethfrm);
//break;
}
/* Setting the FCframe_t StructureStart Pointer to the EthernetFrame*/
Ethfrm->ptr->StructureStart = Ethfrm;
....
.....
....
}
}
Everytime i break i break out of the while loop but I want to break out of the if statement with the true arguement and I'm kinda not sure how to do it simply without just overdoing it.