mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-06-05 04:43:44 +02:00
Fix Sscanf use in tun_darwin
License: MIT Signed-off-by: Filippo Valsorda <valsorda@google.com>
This commit is contained in:
parent
84f52ce0d6
commit
7a527f7c89
1 changed files with 2 additions and 2 deletions
|
@ -100,8 +100,8 @@ func (tun *NativeTun) RoutineRouteListener(tunIfindex int) {
|
||||||
func CreateTUN(name string) (TUNDevice, error) {
|
func CreateTUN(name string) (TUNDevice, error) {
|
||||||
ifIndex := -1
|
ifIndex := -1
|
||||||
if name != "utun" {
|
if name != "utun" {
|
||||||
fmt.Sscanf(name, "utun%d", &ifIndex)
|
_, err := fmt.Sscanf(name, "utun%d", &ifIndex)
|
||||||
if ifIndex < 0 {
|
if err != nil || ifIndex < 0 {
|
||||||
return nil, fmt.Errorf("Interface name must be utun[0-9]*")
|
return nil, fmt.Errorf("Interface name must be utun[0-9]*")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue