- if (!qflag)
- (void)printf("ethertype %s (0x%04x), length %u: ",
- tok2str(ethertype_values,"Unknown", EXTRACT_16BITS(&sllp->sll_protocol)),
- EXTRACT_16BITS(&sllp->sll_protocol),
- length);
+ if (!qflag) {
+ ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
+
+ if (ether_type <= ETHERMTU) {
+ /*
+ * Not an Ethernet type; what type is it?
+ */
+ switch (ether_type) {
+
+ case LINUX_SLL_P_802_3:
+ /*
+ * Ethernet_802.3 IPX frame.
+ */
+ (void)printf("802.3");
+ break;
+
+ case LINUX_SLL_P_802_2:
+ /*
+ * 802.2.
+ */
+ (void)printf("802.3");
+ break;
+
+ default:
+ /*
+ * What is it?
+ */
+ (void)printf("ethertype Unknown (0x%04x)",
+ ether_type);
+ break;
+ }
+ } else {
+ (void)printf("ethertype %s (0x%04x)",
+ tok2str(ethertype_values, "Unknown", ether_type),
+ ether_type);
+ }
+ (void)printf(", length %u: ", length);
+ }