mirror of
https://github.com/h44z/wg-portal.git
synced 2026-12-05 19:56:06 +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
|
table = tableIn
|
||||||
fwmark = fwMarkIn
|
fwmark = fwMarkIn
|
||||||
|
|
||||||
if fwmark == 0 {
|
if fwmark == 0 && link != nil {
|
||||||
// generate a new (temporary) firewall mark based on the interface index
|
// generate a new (temporary) firewall mark based on the interface index
|
||||||
fwmark = uint32(c.cfg.Advanced.RouteTableOffset + link.Attrs().Index)
|
fwmark = uint32(c.cfg.Advanced.RouteTableOffset + link.Attrs().Index)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user