cmd/tailscale,ipn,net/netutil: remove rp_filter strict mode warnings (#18863)
PR #18860 adds firewall rules in the mangle table to save outbound packet marks to conntrack and restore them on reply packets before the routing decision. When reply packets have their marks restored, the kernel uses the correct routing table (based on the mark) and the packets pass the rp_filter check. This makes the risk check and reverse path filtering warnings unnecessary. Updates #3310 Fixes tailscale/corp#37846 Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
This commit is contained in:
@@ -28,7 +28,6 @@ import (
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/health/healthmsg"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/ipnauth"
|
||||
@@ -100,9 +99,6 @@ func init() {
|
||||
Register("check-udp-gro-forwarding", (*Handler).serveCheckUDPGROForwarding)
|
||||
Register("set-udp-gro-forwarding", (*Handler).serveSetUDPGROForwarding)
|
||||
}
|
||||
if buildfeatures.HasUseExitNode && runtime.GOOS == "linux" {
|
||||
Register("check-reverse-path-filtering", (*Handler).serveCheckReversePathFiltering)
|
||||
}
|
||||
if buildfeatures.HasClientMetrics {
|
||||
Register("upload-client-metrics", (*Handler).serveUploadClientMetrics)
|
||||
}
|
||||
@@ -780,32 +776,6 @@ func (h *Handler) serveCheckSOMarkInUse(w http.ResponseWriter, r *http.Request)
|
||||
})
|
||||
}
|
||||
|
||||
func (h *Handler) serveCheckReversePathFiltering(w http.ResponseWriter, r *http.Request) {
|
||||
if !h.PermitRead {
|
||||
http.Error(w, "reverse path filtering check access denied", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
var warning string
|
||||
|
||||
state := h.b.Sys().NetMon.Get().InterfaceState()
|
||||
warn, err := netutil.CheckReversePathFiltering(state)
|
||||
if err == nil && len(warn) > 0 {
|
||||
var msg strings.Builder
|
||||
msg.WriteString(healthmsg.WarnExitNodeUsage + ":\n")
|
||||
for _, w := range warn {
|
||||
msg.WriteString("- " + w + "\n")
|
||||
}
|
||||
msg.WriteString(healthmsg.DisableRPFilter)
|
||||
warning = msg.String()
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(struct {
|
||||
Warning string
|
||||
}{
|
||||
Warning: warning,
|
||||
})
|
||||
}
|
||||
|
||||
func (h *Handler) serveCheckUDPGROForwarding(w http.ResponseWriter, r *http.Request) {
|
||||
if !h.PermitRead {
|
||||
http.Error(w, "UDP GRO forwarding check access denied", http.StatusForbidden)
|
||||
|
||||
Reference in New Issue
Block a user