Skip to content

Commit 78b8f38

Browse files
committed
add inner ether frame for loopback interface data.
1 parent b9f1484 commit 78b8f38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/sockets/sockets.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,9 @@ PHP_FUNCTION(socket_recvfrom)
17061706
break;
17071707
}
17081708
case ETH_P_LOOP: {
1709+
struct ethhdr *innere = (struct ethhdr *)((unsigned char *)e + ETH_HLEN);
1710+
add_assoc_string(&zpayload, "macsrc", ether_ntoa((struct ether_addr *)innere->h_source));
1711+
add_assoc_string(&zpayload, "macdst", ether_ntoa((struct ether_addr *)innere->h_dest));
17091712
break;
17101713
}
17111714
default:

0 commit comments

Comments
 (0)