1 Star 0 Fork 48

yc555/lwip

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0136-fix-vlan-filter-bug.patch 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
zhengjiebing 提交于 2024-05-24 09:34 . fix vlan filter bug
diff --git a/src/netif/ethernet.c b/src/netif/ethernet.c
index d0d68b3..5ba6d95 100644
--- a/src/netif/ethernet.c
+++ b/src/netif/ethernet.c
@@ -123,7 +123,9 @@ ethernet_input(struct pbuf *p, struct netif *netif)
goto free_and_return;
}
#if GAZELLE_ENABLE
- if (netif->vlan_enable && !(netif->txol_flags & RTE_ETH_RX_OFFLOAD_VLAN_FILTER) && VLAN_ID(vlan) != netif->vlan_tci) {
+ /* 1.if vlan mode is not enable, ignore VLAN packets.
+ 2.if vlan mode is enable, ignore packets not for our VLAN */
+ if (netif->vlan_enable == false || (netif->vlan_enable && VLAN_ID(vlan) != netif->vlan_tci)) {
goto free_and_return;
}
#endif
@@ -141,6 +143,9 @@ ethernet_input(struct pbuf *p, struct netif *netif)
}
#endif /* defined(LWIP_HOOK_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK) || defined(ETHARP_VLAN_CHECK_FN) */
type = vlan->tpid;
+ } else if (netif->vlan_enable && !(netif->txol_flags & RTE_ETH_RX_OFFLOAD_VLAN_STRIP)) {
+ /* if vlan mode is enable but vlan strip offload is off, ignore packets without vlan info. */
+ goto free_and_return;
}
#endif /* ETHARP_SUPPORT_VLAN */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangchen555/lwip.git
git@gitee.com:yangchen555/lwip.git
yangchen555
lwip
lwip
master

搜索帮助