Do assorted nitpicking in diagnostics while I'm here:
- Use __func__ consistently instead of copying function name to message strings. Code tends to migrate around source files. - DIAGNOSTIC is for information, INVARIANTS is for panics.
This commit is contained in:
parent
330fd412b5
commit
ffdd61c31d
@ -536,8 +536,8 @@ vlan_start(struct ifnet *ifp)
|
|||||||
evl->evl_encap_proto = htons(ETHERTYPE_VLAN);
|
evl->evl_encap_proto = htons(ETHERTYPE_VLAN);
|
||||||
evl->evl_tag = htons(ifv->ifv_tag);
|
evl->evl_tag = htons(ifv->ifv_tag);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("vlan_start: %*D\n", (int)sizeof(*evl),
|
printf("%s: %*D\n", (int)sizeof(*evl),
|
||||||
(unsigned char *)evl, ":");
|
__func__, (unsigned char *)evl, ":");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,8 +587,8 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
}
|
}
|
||||||
evl = mtod(m, struct ether_vlan_header *);
|
evl = mtod(m, struct ether_vlan_header *);
|
||||||
KASSERT(ntohs(evl->evl_encap_proto) == ETHERTYPE_VLAN,
|
KASSERT(ntohs(evl->evl_encap_proto) == ETHERTYPE_VLAN,
|
||||||
("vlan_input: bad encapsulated protocols (%u)",
|
("%s: bad encapsulation protocol (%u)",
|
||||||
ntohs(evl->evl_encap_proto)));
|
__func__, ntohs(evl->evl_encap_proto)));
|
||||||
|
|
||||||
tag = EVL_VLANOFTAG(ntohs(evl->evl_tag));
|
tag = EVL_VLANOFTAG(ntohs(evl->evl_tag));
|
||||||
|
|
||||||
@ -601,9 +601,9 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
tag = (u_int) -1;
|
tag = (u_int) -1;
|
||||||
#ifdef DIAGNOSTIC
|
#ifdef INVARIANTS
|
||||||
panic("vlan_input: unsupported if type %u",
|
panic("%s: unsupported if_type (%u)",
|
||||||
ifp->if_type);
|
__func__, ifp->if_type);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -619,13 +619,13 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_noproto++;
|
ifp->if_noproto++;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("vlan_input: tag %d, no interface\n", tag);
|
printf("%s: tag %d, no interface\n", __func__, tag);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VLAN_UNLOCK(); /* XXX extend below? */
|
VLAN_UNLOCK(); /* XXX extend below? */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("vlan_input: tag %d, parent %s\n", tag, ifv->ifv_p->if_xname);
|
printf("%s: tag %d, parent %s\n", __func__, tag, ifv->ifv_p->if_xname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mtag == NULL) {
|
if (mtag == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user