Skip to content

Commit 582b0fe

Browse files
committed
fix: assign value of multicast setting properly
Fix https://github.com/siderolabs/talos/pull/12233/files#r2564186653 Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com> (cherry picked from commit 7f7079f)
1 parent 16aa6ac commit 582b0fe

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/app/machined/pkg/controllers/network/link_config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/siderolabs/gen/optional"
1818
"github.com/siderolabs/gen/pair/ordered"
1919
"github.com/siderolabs/gen/xslices"
20+
"github.com/siderolabs/go-pointer"
2021
"github.com/siderolabs/go-procfs/procfs"
2122
"go.uber.org/zap"
2223

@@ -440,8 +441,7 @@ func (ctrl *LinkConfigController) processLinkConfigs(logger *zap.Logger, linkMap
440441
}
441442

442443
if multicast, ok := linkConfig.Multicast().Get(); ok {
443-
linkMap[linkName].Multicast = new(bool)
444-
*linkMap[linkName].Multicast = multicast
444+
linkMap[linkName].Multicast = pointer.To(multicast)
445445
}
446446

447447
switch specificLinkConfig := linkConfig.(type) {

internal/app/machined/pkg/controllers/network/link_spec_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/cosi-project/runtime/pkg/safe"
2020
"github.com/jsimonetti/rtnetlink/v2"
2121
"github.com/siderolabs/gen/xslices"
22+
"github.com/siderolabs/go-pointer"
2223
"github.com/stretchr/testify/assert"
2324
"github.com/stretchr/testify/require"
2425
"github.com/stretchr/testify/suite"
@@ -102,8 +103,7 @@ func (suite *LinkSpecSuite) TestDummy() {
102103

103104
// attempt to change multicast flag
104105
ctest.UpdateWithConflicts(suite, dummy, func(r *network.LinkSpec) error {
105-
r.TypedSpec().Multicast = new(bool)
106-
*r.TypedSpec().Multicast = true
106+
r.TypedSpec().Multicast = pointer.To(true)
107107

108108
return nil
109109
})
@@ -115,7 +115,7 @@ func (suite *LinkSpecSuite) TestDummy() {
115115
// attempt to disable multicast
116116
ctest.UpdateWithConflicts(suite, dummy, func(r *network.LinkSpec) error {
117117
r.TypedSpec().Multicast = new(bool)
118-
*r.TypedSpec().Multicast = false
118+
r.TypedSpec().Multicast = pointer.To(false)
119119

120120
return nil
121121
})

0 commit comments

Comments
 (0)