Update goodbyedpi.c

This commit is contained in:
SashaXser 2023-09-10 14:50:10 +04:00 committed by GitHub
parent 8f9e677eba
commit af3710abeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -184,12 +184,17 @@ static void add_filter_str(int proto, int port) {
size_t new_filter_size = strlen(filter_string) + (proto == IPPROTO_UDP ? strlen(udp) : strlen(tcp)) + 16;
char *new_filter = malloc(new_filter_size);
sprintf(new_filter, proto == IPPROTO_UDP ? udp : tcp, port, port);
if (proto == IPPROTO_UDP) {
snprintf(new_filter, new_filter_size, udp, port, port);
} else {
snprintf(new_filter, new_filter_size, tcp, port, port);
}
free(filter_string);
filter_string = new_filter;
}
static void add_ip_id_str(int id) {
const char *ipid = " or ip.Id == %d";
char *addfilter = malloc(strlen(ipid) + 16);