Cedar/BridgeUnix: make sure to destroy tap device for bridge on FreeBSD

Also, rename NewTap/FreeTap to NewBridgeTap/FreeBridgeTap because these
functions are used to create/destroy tap device used for bridge
destination.
This commit is contained in:
Koichiro IWAO committed 2023-06-15 00:15:17 +09:00
1 parent 696a9bc0a1
commit 09708bc8cb
3 files changed
+36 -14

No files matched your search

+3 -3
View File
@@ -506,7 +506,7 @@ ETH *OpenEthLinux(char *name, bool local, bool tapmode, char *tapaddr)
{
#ifndef NO_VLAN
// In tap mode
VLAN *v = NewTap(name, tapaddr, true);
VLAN *v = NewBridgeTap(name, tapaddr, true);
if (v == NULL)
{
return NULL;
@@ -1399,7 +1399,7 @@ ETH *OpenEthBSD(char *name, bool local, bool tapmode, char *tapaddr)
{
#ifndef NO_VLAN
// In tap mode
VLAN *v = NewTap(name, tapaddr, true);
VLAN *v = NewBridgeTap(name, tapaddr, true);
if (v == NULL)
{
return NULL;
@@ -1475,7 +1475,7 @@ void CloseEth(ETH *e)
if (e->Tap != NULL)
{
#ifndef NO_VLAN
FreeTap(e->Tap);
FreeBridgeTap(e->Tap);
#endif // NO_VLAN
}