Clean up the switch statement for the ToS.

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.
This commit is contained in:
Guy Harris 2016-12-10 11:04:05 -08:00
parent 514f392197
commit 17a3c28858

View 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)