Ignore v6 exit node notification

This commit is contained in:
Viktor Liu
2026-04-28 12:10:39 +02:00
parent 7e683f79b7
commit b0f5d78df1

View File

@@ -107,7 +107,7 @@ func (e *Manager) handleEvent(event *proto.SystemEvent) {
handlers := slices.Clone(e.handlers)
e.mu.Unlock()
if event.UserMessage != "" && (enabled || event.Severity == proto.SystemEvent_CRITICAL) {
if event.UserMessage != "" && (enabled || event.Severity == proto.SystemEvent_CRITICAL) && !isV6DefaultRoutePartner(event) {
title := e.getEventTitle(event)
body := event.UserMessage
id := event.Metadata["id"]
@@ -128,6 +128,14 @@ func (e *Manager) AddHandler(handler Handler) {
e.handlers = append(e.handlers, handler)
}
// isV6DefaultRoutePartner reports whether the event is the IPv6 half of a
// paired v4/v6 default-route event. Management always pairs ::/0 with 0.0.0.0/0
// for exit nodes, so the v4 partner already drives the user-facing toast and
// the v6 one is suppressed to avoid a duplicate notification.
func isV6DefaultRoutePartner(event *proto.SystemEvent) bool {
return event.Category == proto.SystemEvent_NETWORK && event.Metadata["network"] == "::/0"
}
func (e *Manager) getEventTitle(event *proto.SystemEvent) string {
var prefix string
switch event.Severity {