| 131 | } |
| 132 | |
| 133 | void packet_socket_send(int s, char *buffer, int size) { |
| 134 | struct sockaddr_ll sa; |
| 135 | memset(&sa, 0, sizeof(sa)); |
| 136 | sa.sll_ifindex = if_nametoindex("lo"); |
| 137 | sa.sll_halen = ETH_ALEN; |
| 138 | |
| 139 | if (sendto(s, buffer, size, 0, (struct sockaddr *)&sa, |
| 140 | sizeof(sa)) < 0) { |
| 141 | perror("[-] sendto(SOCK_RAW)"); |
| 142 | exit(EXIT_FAILURE); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | void loopback_send(char *buffer, int size) { |
| 147 | int s = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW); |
no outgoing calls
no test coverage detected