Skip to content

Commit

Permalink
nim: Exclude CAN interfaces from last resort list
Browse files Browse the repository at this point in the history
This commit excludes from the last resort list the CAN interfaces (which
are non TCP/IP), so any attempt of connection through these interfaces
will always fail.

Signed-off-by: Renê de Souza Pinto <[email protected]>
  • Loading branch information
rene authored and eriknordmark committed Nov 13, 2023
1 parent 351ef58 commit fbd18b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/pillar/cmd/nim/nim.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,14 +1067,18 @@ func (n *nim) includeLastResortPort(ifAttrs netmonitor.IfAttrs) bool {
if ifAttrs.IsLoopback || !ifAttrs.WithBroadcast || ifAttrs.Enslaved {
return false
}
if ifAttrs.IfType == "device" {

switch ifAttrs.IfType {
case "device":
return true
}
if ifAttrs.IfType == "bridge" {
case "bridge":
// Was this originally an ethernet interface turned into a bridge?
_, exists, _ := n.networkMonitor.GetInterfaceIndex("k" + ifName)
return exists
case "can", "vcan":
return false
}

return false
}

Expand Down

0 comments on commit fbd18b0

Please sign in to comment.