xtables-addons: nf_nat_rtsp does not rewrite destination= in server replies (XXX: unmangle stub)

Aperta
#31,311 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, linux
Ambito
networking

Direzione di ricerca

Start in net/xtables-addons/patches/100-add-rtsp-conntrack.patch at nf_nat_rtsp() in extensions/rtsp/nf_nat_rtsp.c: compare the outbound destaction=auto rewrite with the IP_CT_DIR_REPLY branch marked XXX: unmangle. Work out how the client's original address is recoverable from the conntrack tuple in the reply direction, then rewrite each destination= back to it while keeping the message length. Done means the server reply's Transport: header reaches the STB with the LAN IP, confirmed by the WAN/LAN capture described.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Package Name

kmod-ipt-nathelper-rtsp (xtables-addons), file net/xtables-addons/patches/100-add-rtsp-conntrack.patch

Maintainer

@jow-

OpenWrt Version

24.10.6

OpenWrt Target/Subtarget

x64

Steps to Reproduce

Description

For an RTSP SETUP request, nf_nat_rtsp rewrites every destination= in the Transport: header to the router’s external IP (destaction=auto). In the reply direction the function does nothing:

c
case IP_CT_DIR_REPLY:
	pr_debug("unmangle ! %u\n", ctinfo);
	/* XXX: unmangle */
	rc = NF_ACCEPT;
	break;

(nf_nat_rtsp() in extensions/rtsp/nf_nat_rtsp.c, created by the patch above. The stub is present on openwrt-24.10, openwrt-25.12 and master.)

The server echoes the router’s IP in the reply’s Transport: header, and that echo reaches the client unchanged. If the external IP is longer than the client’s LAN IP, the reply also differs in length from what the client sent.

My IPTV STB accepts any IP in the echoed destination= as long as the length matches the original, but fails when it doesn’t. With the current helper, the reply has the router’s IP and the wrong length, so stream does not start.

Reproduce

STB on a private LAN IP behind OpenWrt NAT, RTSP helper assigned to the RTSP port.
The STB sends SETUP with N destination= fields. The helper rewrites all N to the router’s external IP.
Capture the server’s reply on the WAN side and on the LAN side.

Expected

The reply direction should restore each destination= to the client’s original IP, mirroring the outbound rewrite.

Actual Behaviour

The reply direction does not restore each destination= to the client’s original IP.

Confirmation Checklist
Lingua principale
Makefile
Stelle
4.7k
Fork
4k
Merge medio
2g 2h
PR unite (30g)
251

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openwrt/packages

Tutte le issue di openwrt/packages

Issue simili

Altre issue su Networking

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.