mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-18 20:00:28 +07:00
fix: rebinding wg/tun not work (#271)
This commit is contained in:
@ -8,7 +8,6 @@ package control
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/daeuniverse/softwind/transport/meek"
|
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"os"
|
"os"
|
||||||
@ -36,6 +35,7 @@ import (
|
|||||||
"github.com/daeuniverse/softwind/pool"
|
"github.com/daeuniverse/softwind/pool"
|
||||||
"github.com/daeuniverse/softwind/protocol/direct"
|
"github.com/daeuniverse/softwind/protocol/direct"
|
||||||
"github.com/daeuniverse/softwind/transport/grpc"
|
"github.com/daeuniverse/softwind/transport/grpc"
|
||||||
|
"github.com/daeuniverse/softwind/transport/meek"
|
||||||
dnsmessage "github.com/miekg/dns"
|
dnsmessage "github.com/miekg/dns"
|
||||||
"github.com/mohae/deepcopy"
|
"github.com/mohae/deepcopy"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -190,11 +190,6 @@ func NewControlPlane(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Bind to links. Binding should be advance of dialerGroups to avoid un-routable old connection.
|
/// Bind to links. Binding should be advance of dialerGroups to avoid un-routable old connection.
|
||||||
// Add clsact qdisc
|
|
||||||
for _, ifname := range common.Deduplicate(append(append([]string{}, global.LanInterface...), global.WanInterface...)) {
|
|
||||||
_ = core.addQdisc(ifname)
|
|
||||||
_ = core.mapLinkType(ifname)
|
|
||||||
}
|
|
||||||
// Bind to LAN
|
// Bind to LAN
|
||||||
if len(global.LanInterface) > 0 {
|
if len(global.LanInterface) > 0 {
|
||||||
if err = core.setupRoutingPolicy(); err != nil {
|
if err = core.setupRoutingPolicy(); err != nil {
|
||||||
|
@ -425,6 +425,8 @@ func (c *controlPlaneCore) _bindLan(ifname string) error {
|
|||||||
if err = CheckSendRedirects(ifname); err != nil {
|
if err = CheckSendRedirects(ifname); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
_ = c.addQdisc(ifname)
|
||||||
|
_ = c.mapLinkType(ifname)
|
||||||
/// Insert an elem into IfindexParamsMap.
|
/// Insert an elem into IfindexParamsMap.
|
||||||
ifParams, err := getIfParamsFromLink(link)
|
ifParams, err := getIfParamsFromLink(link)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -564,6 +566,9 @@ func (c *controlPlaneCore) _bindWan(ifname string) error {
|
|||||||
if link.Attrs().Index == consts.LoopbackIfIndex {
|
if link.Attrs().Index == consts.LoopbackIfIndex {
|
||||||
return fmt.Errorf("cannot bind to loopback interface")
|
return fmt.Errorf("cannot bind to loopback interface")
|
||||||
}
|
}
|
||||||
|
_ = c.addQdisc(ifname)
|
||||||
|
_ = c.mapLinkType(ifname)
|
||||||
|
|
||||||
/// Insert an elem into IfindexParamsMap.
|
/// Insert an elem into IfindexParamsMap.
|
||||||
ifParams, err := getIfParamsFromLink(link)
|
ifParams, err := getIfParamsFromLink(link)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user