radvd: ignore requests from other interfaces than the configured one
Announcing networks into uplinks is never a good idea 🙈
This commit is contained in:
parent
f4dd972e54
commit
225c8e6abd
@ -19,6 +19,7 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"net/netip"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -93,6 +94,10 @@ func (s *Server) Serve(ifname string, conn net.PacketConn) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !strings.HasSuffix(addr.String(), "%"+ifname) {
|
||||
log.Printf("ignoring off-interface request from %v", addr)
|
||||
continue
|
||||
}
|
||||
// TODO: isn’t this guaranteed by the filter above?
|
||||
if n == 0 ||
|
||||
ipv6.ICMPType(buf[0]) != ipv6.ICMPTypeRouterSolicitation {
|
||||
|
Loading…
x
Reference in New Issue
Block a user