]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Clean up the switch statement for the ToS.
authorGuy Harris <[email protected]>
Sat, 10 Dec 2016 19:04:05 +0000 (11:04 -0800)
committerGuy Harris <[email protected]>
Sat, 10 Dec 2016 19:04:05 +0000 (11:04 -0800)
Put in an explicit "do nothing" clause for a value of 0, to make it
clearer that we handle that case.

Put a break after each case.

Add blank lines between cases.

print-ip.c

index 6103b11aded1db22b8ed7fee808a3588b5a0d70b..69e621d28792a016ac3caad7162d311aa5152fda 100644 (file)
@@ -581,14 +581,21 @@ ip_print(netdissect_options *ndo,
             ND_PRINT((ndo, "(tos 0x%x", (int)ipds->ip->ip_tos));
             /* ECN bits */
             switch (ipds->ip->ip_tos & 0x03) {
+
+            case 0:
+                break;
+
             case 1:
                 ND_PRINT((ndo, ",ECT(1)"));
                 break;
+
             case 2:
                 ND_PRINT((ndo, ",ECT(0)"));
                 break;
+
             case 3:
                 ND_PRINT((ndo, ",CE"));
+                break;
             }
 
             if (ipds->ip->ip_ttl >= 1)