mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-09-23 19:59:21 +03:00
Put TUN down on client disconnect.
On startup client creates TUN interface in UP state and kept it UP even if connection to the server was lost. Creating interface in DOWN state, turning it UP on successful (re-)connection to server and DOWN on either disconnect or connection loss would enable DHCP client (say dhclient5) to detect necessity for lease renewal. Added a client configuration parameter to create TUN interface in DOWN state and commands to enable, disable, and query the configuration parameter. Enabling the parameter causes client to put all unused TUN interfaces DOWN, create new TUN interfaces in DOWN state, and turn TUN interfaces corresponding to active sessions DOWN on connection loss or disconnecting from server. Disabling the parameter forces client to turn all TUN interfaces UP and create new TUN interfaces in UP state. Default value is 'Disable'.
This commit is contained in:
committed by
Davide Beatrici
parent
828d3b2ffb
commit
59e1483dbf
@ -129,7 +129,7 @@ struct VLAN
|
||||
|
||||
// Function prototype
|
||||
VLAN *NewVLan(char *instance_name, VLAN_PARAM *param);
|
||||
VLAN *NewTap(char *name, char *mac_address);
|
||||
VLAN *NewTap(char *name, char *mac_address, bool create_up);
|
||||
void FreeVLan(VLAN *v);
|
||||
CANCEL *VLanGetCancel(VLAN *v);
|
||||
bool VLanGetNextPacket(VLAN *v, void **buf, UINT *size);
|
||||
@ -154,15 +154,16 @@ struct UNIX_VLAN_LIST
|
||||
int fd; // fd
|
||||
};
|
||||
|
||||
int UnixCreateTapDevice(char *name, UCHAR *mac_address);
|
||||
int UnixCreateTapDeviceEx(char *name, char *prefix, UCHAR *mac_address);
|
||||
int UnixCreateTapDevice(char *name, UCHAR *mac_address, bool create_up);
|
||||
int UnixCreateTapDeviceEx(char *name, char *prefix, UCHAR *mac_address, bool create_up);
|
||||
void UnixCloseTapDevice(int fd);
|
||||
void UnixVLanInit();
|
||||
void UnixVLanFree();
|
||||
bool UnixVLanCreate(char *name, UCHAR *mac_address);
|
||||
bool UnixVLanCreateEx(char *name, char *prefix, UCHAR *mac_address);
|
||||
bool UnixVLanCreate(char *name, UCHAR *mac_address, bool create_up);
|
||||
bool UnixVLanCreateEx(char *name, char *prefix, UCHAR *mac_address, bool create_up);
|
||||
TOKEN_LIST *UnixVLanEnum();
|
||||
void UnixVLanDelete(char *name);
|
||||
bool UnixVLanSetState(char* name, bool state_up);
|
||||
int UnixVLanGet(char *name);
|
||||
int UnixCompareVLan(void *p1, void *p2);
|
||||
|
||||
|
Reference in New Issue
Block a user