core: improve opti with else if instead of if

This commit is contained in:
Starnakin 2025-05-27 13:28:03 +02:00
parent e7ca63eaa6
commit 60f23e9250

View File

@ -26,12 +26,12 @@ static void dispatch_callback(u_char *user, const struct pcap_pkthdr *h,
sizeof(struct tcphdr)) {
tcp_response(packet, data);
}
if (iphdr->protocol == IPPROTO_UDP &&
else if (iphdr->protocol == IPPROTO_UDP &&
h->caplen >= sizeof(struct ether_header) + sizeof(struct iphdr) +
sizeof(struct udphdr)) {
udp_response(packet, data);
}
if (iphdr->protocol == IPPROTO_ICMP &&
else if (iphdr->protocol == IPPROTO_ICMP &&
h->caplen >= sizeof(struct ether_header) + sizeof(struct iphdr) +
sizeof(struct icmphdr)) {
icmp_response(packet, data);