Add debug assert to my last commit and improve comment in opt.h

This commit is contained in:
Dirk Ziegelmeier 2016-08-25 14:12:49 +02:00
parent 475d49440c
commit aeb3834219
2 changed files with 3 additions and 0 deletions

View File

@ -2497,6 +2497,7 @@
* LWIP_HOOK_VLAN_SET(netif, eth_hdr, vlan_hdr):
* Hook can be used to set prio_vid field of vlan_hdr.
* Called from ethernet_output() if VLAN support is enabled.
* Signature: s32_t my_hook_vlan_set(struct netif* netif, struct pbuf* pbuf, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);
* Arguments:
* - netif: struct netif that the packet will be sent through
* - p: struct pbuf packet to be sent

View File

@ -265,6 +265,8 @@ ethernet_output(struct netif* netif, struct pbuf* p,
if (vlan_prio_vid >= 0) {
struct eth_vlan_hdr* vlanhdr;
LWIP_ASSERT("prio_vid must be <= 0xFFFF", vlan_prio_vid <= 0xFFFF);
if (pbuf_header(p, SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR) != 0) {
goto pbuf_header_failed;
}