diff --git a/srcs/lwip/src/arch_linux/netif/pcapif.c b/srcs/lwip/src/arch_linux/netif/pcapif.c index 10814c3..aa6e7d6 100644 --- a/srcs/lwip/src/arch_linux/netif/pcapif.c +++ b/srcs/lwip/src/arch_linux/netif/pcapif.c @@ -330,14 +330,15 @@ static err_t netif_input_data(struct pbuf *p, struct netif *inp) { if (ebuf != NULL) { if (strlen(pContext->session.data.svrBaseMac) == 0) { if (strlen(pContext->session.data.svrBaseMac) == 0) { + const struct eth_hdr *payloadEth = (const struct eth_hdr *)ebuf->payload; sprintf(pContext->session.data.svrBaseMac, "%02X:%02X:%02X:%02X:%02X:%02X", - eth->src.addr[0], - eth->src.addr[1], - eth->src.addr[2], - eth->src.addr[3], - eth->src.addr[4], - eth->src.addr[5]); + payloadEth->src.addr[0], + payloadEth->src.addr[1], + payloadEth->src.addr[2], + payloadEth->src.addr[3], + payloadEth->src.addr[4], + payloadEth->src.addr[5]); } }