From: Guy Harris Date: Fri, 4 Apr 2014 18:49:03 +0000 (-0700) Subject: Make the code to set the type a bit clearer. X-Git-Tag: libpcap-1.6.0-bp~38 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/ab8f67d0a528c8a08003b2e2ad3bfacbd0e3fd4d Make the code to set the type a bit clearer. Make it if (case 1) type = type 1; else if (case 2) type = type 2; and indent it a bit more clearly. --- diff --git a/pcap-netfilter-linux.c b/pcap-netfilter-linux.c index aa8edbba..2a5812b2 100644 --- a/pcap-netfilter-linux.c +++ b/pcap-netfilter-linux.c @@ -117,12 +117,11 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c } if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_ULOG && - NFNL_MSG_TYPE(nlh->nlmsg_type) == NFULNL_MSG_PACKET) - type = NFLOG; - - if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_QUEUE && - NFNL_MSG_TYPE(nlh->nlmsg_type) == NFQNL_MSG_PACKET) - type = NFQUEUE; + NFNL_MSG_TYPE(nlh->nlmsg_type) == NFULNL_MSG_PACKET) + type = NFLOG; + else if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_QUEUE && + NFNL_MSG_TYPE(nlh->nlmsg_type) == NFQNL_MSG_PACKET) + type = NFQUEUE; if (type != OTHER) { const unsigned char *payload = NULL;