| 144 | } |
| 145 | |
| 146 | void loopback_send(char *buffer, int size) { |
| 147 | int s = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW); |
| 148 | if (s == -1) { |
| 149 | perror("[-] socket(SOCK_RAW)"); |
| 150 | exit(EXIT_FAILURE); |
| 151 | } |
| 152 | |
| 153 | packet_socket_send(s, buffer, size); |
| 154 | } |
| 155 | // (1-1) 消耗 kmalloc-2048 |
| 156 | int packet_sock_kmalloc() { |
| 157 | int s = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP)); |
no test coverage detected