Skip to content

Commit

Permalink
Fix port auto neg handling to avoid unappliable diff
Browse files Browse the repository at this point in the history
Fixes #658

Signed-off-by: Sergei Lukianov <[email protected]>
  • Loading branch information
Frostman committed Jan 28, 2025
1 parent 2eb2203 commit a3e3d4d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions pkg/agent/dozer/bcm/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ func planControlLink(agent *agentapi.Agent, spec *dozer.Spec) error {
prefixLen, _ := ipNet.Mask.Size()

spec.Interfaces[controlIface] = &dozer.SpecInterface{
Description: pointer.To("Management link"),
Enabled: pointer.To(true),
Description: pointer.To("Management link"),
Enabled: pointer.To(true),
AutoNegotiate: pointer.To(true),
// Speed: getPortSpeed(agent, controlIface), // TODO do we need to set it for management port?
Subinterfaces: map[uint32]*dozer.SpecSubinterface{
0: {
Expand Down Expand Up @@ -2430,21 +2431,15 @@ func planPortAutoNegs(agent *agentapi.Agent, spec *dozer.Spec) error {
}

for name, iface := range spec.Interfaces {
if !isHedgehogPortName(name) || !autoNegAllowed[name] {
if !isHedgehogPortName(name) || strings.HasPrefix(name, wiringapi.ManagementPortPrefix) {
continue
}

val := pointer.To(autoNegDefault[name])

if strings.HasPrefix(name, "M") {
val = pointer.To(true)
}

iface.AutoNegotiate = val
iface.AutoNegotiate = pointer.To(autoNegDefault[name])
}

for name, autoNeg := range agent.Spec.Switch.PortAutoNegs {
if !isHedgehogPortName(name) || strings.HasPrefix(name, "M") || !autoNegAllowed[name] {
if !isHedgehogPortName(name) || strings.HasPrefix(name, wiringapi.ManagementPortPrefix) || !autoNegAllowed[name] {
continue
}

Expand Down

0 comments on commit a3e3d4d

Please sign in to comment.