core: improve opti with else if instead of if
This commit is contained in:
parent
e7ca63eaa6
commit
60f23e9250
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user