mirror of
https://github.com/h44z/wg-portal.git
synced 2026-12-05 11:46:09 +01:00
fix(wgcontroller): avoid nil deref in RemoveRoutes when the link is already gone (#786)
This commit is contained in:
@@ -796,7 +796,7 @@ func (c LocalController) getOrCreateRoutingTableAndFwMark(
|
||||
table = tableIn
|
||||
fwmark = fwMarkIn
|
||||
|
||||
if fwmark == 0 {
|
||||
if fwmark == 0 && link != nil {
|
||||
// generate a new (temporary) firewall mark based on the interface index
|
||||
fwmark = uint32(c.cfg.Advanced.RouteTableOffset + link.Attrs().Index)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user