Skip to content

Commit 629ee21

Browse files
Support interfaces without MAC
1 parent 0dae2f9 commit 629ee21

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

router_advertisement.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ func sendRouterAdvertisement(c *ndp.Conn, receiver netip.Addr, stateless bool, r
133133

134134
RouterSelectionPreference: ndp.High,
135135
RouterLifetime: routerLifetime,
136-
Options: []ndp.Option{
137-
&ndp.LinkLayerAddress{
138-
Direction: ndp.Source,
139-
Addr: routerMAC,
140-
},
141-
},
136+
}
137+
138+
if len(routerMAC) == 0 {
139+
raMessage.Options = append(raMessage.Options, &ndp.LinkLayerAddress{
140+
Direction: ndp.Source,
141+
Addr: routerMAC,
142+
})
142143
}
143144

144145
if dnsAddr != nil {

0 commit comments

Comments
 (0)