Skip to content

Commit 4e36ea8

Browse files
committed
add inner ether frame for loopback interface data.
1 parent 886e231 commit 4e36ea8

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
@@ -1704,6 +1704,9 @@ PHP_FUNCTION(socket_recvfrom)
17041704
break;
17051705
}
17061706
case ETH_P_LOOP: {
1707+
struct ethhdr *innere = (struct ethhdr *)((unsigned char *)e + ETH_HLEN);
1708+
add_assoc_string(&zpayload, "macsrc", ether_ntoa((struct ether_addr *)innere->h_source));
1709+
add_assoc_string(&zpayload, "macdst", ether_ntoa((struct ether_addr *)innere->h_dest));
17071710
break;
17081711
}
17091712
default:

0 commit comments

Comments
 (0)