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"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -93,6 +94,10 @@ func (s *Server) Serve(ifname string, conn net.PacketConn) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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?
|
// TODO: isn’t this guaranteed by the filter above?
|
||||||
if n == 0 ||
|
if n == 0 ||
|
||||||
ipv6.ICMPType(buf[0]) != ipv6.ICMPTypeRouterSolicitation {
|
ipv6.ICMPType(buf[0]) != ipv6.ICMPTypeRouterSolicitation {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user