|
|
@ -237,15 +237,15 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, dnsDomains []string) error
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := e.magicConn.SetPrivateKey(cfg.Interface.PrivateKey); err != nil {
|
|
|
|
if err := e.magicConn.SetPrivateKey(cfg.PrivateKey); err != nil {
|
|
|
|
e.logf("magicsock: %v\n", err)
|
|
|
|
e.logf("magicsock: %v\n", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(apenwarr): only handling the first local address.
|
|
|
|
// TODO(apenwarr): only handling the first local address.
|
|
|
|
// Currently we never use more than one anyway.
|
|
|
|
// Currently we never use more than one anyway.
|
|
|
|
var cidr wgcfg.CIDR
|
|
|
|
var cidr wgcfg.CIDR
|
|
|
|
if len(cfg.Interface.Addresses) > 0 {
|
|
|
|
if len(cfg.Addresses) > 0 {
|
|
|
|
cidr = cfg.Interface.Addresses[0]
|
|
|
|
cidr = cfg.Addresses[0]
|
|
|
|
// TODO(apenwarr): this shouldn't be hardcoded in the client
|
|
|
|
// TODO(apenwarr): this shouldn't be hardcoded in the client
|
|
|
|
cidr.Mask = 10 // route the whole cgnat range
|
|
|
|
cidr.Mask = 10 // route the whole cgnat range
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -253,7 +253,7 @@ func (e *userspaceEngine) Reconfig(cfg *wgcfg.Config, dnsDomains []string) error
|
|
|
|
rs := RouteSettings{
|
|
|
|
rs := RouteSettings{
|
|
|
|
LocalAddr: cidr,
|
|
|
|
LocalAddr: cidr,
|
|
|
|
Cfg: cfg,
|
|
|
|
Cfg: cfg,
|
|
|
|
DNS: cfg.Interface.Dns,
|
|
|
|
DNS: cfg.DNS,
|
|
|
|
DNSDomains: dnsDomains,
|
|
|
|
DNSDomains: dnsDomains,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e.logf("Reconfiguring router. la=%v dns=%v dom=%v\n",
|
|
|
|
e.logf("Reconfiguring router. la=%v dns=%v dom=%v\n",
|
|
|
|