forked from trombik/esp_wireguard
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Free wireguard_device after netif is removed
The wireguard_device stored as the netif state pointer must remain valid until after the netif is removed. During removal, packets may be sent to disconnect TCP sockets and such requiring a valid device for the wireguardif_output function. Move the device free from the wireguardif_shutdown function into a new wireguardif_fini function which is called after the netif_remove. Add a device check in wireguardif_output as a precaution. Make an explicit call to clear the IPv4 address of the Wireguard interface when disconnecting. The call mimics the behavior in netif_remove however it is performed before the Wireguard peers are shutdown. As a result, the TCP reset packets can be sent.
- Loading branch information
1 parent
a441e52
commit 5754fdd
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters