|
From: | Shaofeng Cen |
Subject: | Re: [lwip-users] Bridge Port with DHCP |
Date: | Thu, 16 Dec 2021 15:59:22 +0800 |
After these days of hard work, I finally figure it out! Let me explain what I have done. I use LwIP bridge, add a port which has no mac address to the bridge. Add port and mac fdb to the bridge, so in func 'bridgeif_is_local_mac()' won't return 1. After that, bridgeif will search its fdb to get an output port. As we all know, the port is the port I added before. In 'bridgeif_send_to_ports()', 'portif->linkoutput()' will be called. I connect 'linkoutput' to tap fd's write operation, so the pbuf data will write to the tap device. I have tested DHCP in vm, it can get an IP. In general, I use LwIP bridge and self-designed tapif, create a bridge network environment for vm. |
[Prev in Thread] | Current Thread | [Next in Thread] |