move WFP manipulation to strict route

This commit is contained in:
dyhkwong 2022-11-04 20:14:41 +08:00 committed by GitHub
parent ea5c35f62f
commit 66c48a5777
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,7 +154,7 @@ func (t *NativeTun) configure() error {
}
}
if t.options.AutoRoute {
if t.options.AutoRoute && t.options.StrictRoute {
var engine uintptr
session := &winsys.FWPM_SESSION0{Flags: winsys.FWPM_SESSION_FLAG_DYNAMIC}
err := winsys.FwpmEngineOpen0(nil, winsys.RPC_C_AUTHN_DEFAULT, nil, session, unsafe.Pointer(&engine))