fix: rebinding wg/tun not work (#271)

This commit is contained in:
mzz
2023-08-11 09:19:32 +08:00
committed by GitHub
parent a32bd81637
commit e7f774001a
2 changed files with 6 additions and 6 deletions

View File

@ -425,6 +425,8 @@ func (c *controlPlaneCore) _bindLan(ifname string) error {
if err = CheckSendRedirects(ifname); err != nil {
return err
}
_ = c.addQdisc(ifname)
_ = c.mapLinkType(ifname)
/// Insert an elem into IfindexParamsMap.
ifParams, err := getIfParamsFromLink(link)
if err != nil {
@ -564,6 +566,9 @@ func (c *controlPlaneCore) _bindWan(ifname string) error {
if link.Attrs().Index == consts.LoopbackIfIndex {
return fmt.Errorf("cannot bind to loopback interface")
}
_ = c.addQdisc(ifname)
_ = c.mapLinkType(ifname)
/// Insert an elem into IfindexParamsMap.
ifParams, err := getIfParamsFromLink(link)
if err != nil {