]> The Tcpdump Group git mirrors - libpcap/commitdiff
Make the code to set the type a bit clearer.
authorGuy Harris <[email protected]>
Fri, 4 Apr 2014 18:49:03 +0000 (11:49 -0700)
committerGuy Harris <[email protected]>
Fri, 4 Apr 2014 18:49:03 +0000 (11:49 -0700)
Make it

if (case 1)
type = type 1;
else if (case 2)
type = type 2;

and indent it a bit more clearly.

pcap-netfilter-linux.c

index aa8edbba777234de947ce8e89a59286947ff8b19..2a5812b273afb0272c124cfdd61a9ebb6bf02884 100644 (file)
@@ -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;