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)) {
|
sizeof(struct tcphdr)) {
|
||||||
tcp_response(packet, data);
|
tcp_response(packet, data);
|
||||||
}
|
}
|
||||||
if (iphdr->protocol == IPPROTO_UDP &&
|
else if (iphdr->protocol == IPPROTO_UDP &&
|
||||||
h->caplen >= sizeof(struct ether_header) + sizeof(struct iphdr) +
|
h->caplen >= sizeof(struct ether_header) + sizeof(struct iphdr) +
|
||||||
sizeof(struct udphdr)) {
|
sizeof(struct udphdr)) {
|
||||||
udp_response(packet, data);
|
udp_response(packet, data);
|
||||||
}
|
}
|
||||||
if (iphdr->protocol == IPPROTO_ICMP &&
|
else if (iphdr->protocol == IPPROTO_ICMP &&
|
||||||
h->caplen >= sizeof(struct ether_header) + sizeof(struct iphdr) +
|
h->caplen >= sizeof(struct ether_header) + sizeof(struct iphdr) +
|
||||||
sizeof(struct icmphdr)) {
|
sizeof(struct icmphdr)) {
|
||||||
icmp_response(packet, data);
|
icmp_response(packet, data);
|
||||||
|
Loading…
Reference in New Issue
Block a user