general: fixed a bug which leads to panic when the specified interface not exists

This commit is contained in:
nadoo committed 2021-07-02 01:06:11 +08:00
1 parent 72e57ab6e3
commit 7f85f664e3
11 files changed
+27 -39

No files matched your search

+6 -2
View File
@@ -48,8 +48,12 @@ func NewFwdrGroup(name string, s []string, c *Strategy) *FwdrGroup {
if len(fwdrs) == 0 {
// direct forwarder
fwdrs = append(fwdrs, DirectForwarder(c.IntFace,
time.Duration(c.DialTimeout)*time.Second, time.Duration(c.RelayTimeout)*time.Second))
direct, err := DirectForwarder(c.IntFace,
time.Duration(c.DialTimeout)*time.Second, time.Duration(c.RelayTimeout)*time.Second)
if err != nil {
log.Fatal(err)
}
fwdrs = append(fwdrs, direct)
c.Strategy = "rr"
}