commit 8ae820c6a6eb17c249ca68bbcade54227c0802cc
parent 76234008a274c2d6d33e1e3f96afa6f93d110858
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date: Wed, 16 Sep 2020 14:15:55 +1000
clean up case statements and add fallthroughs
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ngrep.c b/ngrep.c
@@ -428,6 +428,7 @@ setup_pcap_source(void)
break;
case DLT_IEEE802_11_RADIO:
radiotap_present = true;
+ /* FALLTHROUGH */
case DLT_IEEE802_11:
link_offset = IEEE80211HDR_SIZE;
break;
@@ -726,7 +727,6 @@ process(UNUSED u_char *d, struct pcap_pkthdr *h, u_char *p)
ntohs(udp_pkt->uh_sport), ntohs(udp_pkt->uh_dport),
0, udphdr_offset, fragmented, frag_offset, frag_id);
} break;
-
case IPPROTO_ICMP: {
struct icmp *icmp4_pkt =
(struct icmp *)((unsigned char *)ip4_pkt + ip_hl);
@@ -772,7 +772,6 @@ process(UNUSED u_char *d, struct pcap_pkthdr *h, u_char *p)
igmp_pkt->igmp_type, igmp_pkt->igmp_code, 0,
igmphdr_offset, fragmented, frag_offset, frag_id);
} break;
-
default: {
data = (unsigned char *)ip4_pkt + ip_hl;
len -= link_offset + ip_hl;