Commit 8648af1
committed
ip: fix loopback input detection
In commit e5570d2 ("policy: add stateful dynamic source nat
support"), the assignment ip_output_mbuf_data(mbuf)->nh = nh was moved
earlier in the processing path. This assignment overwrites the mbuf
metadata that e points to, since eth_input_mbuf_data and
ip_output_mbuf_data share the same memory area.
As a result, accessing e->domain after this assignment reads garbage
data, causing incorrect routing decisions when checking whether a packet
should be sent to ip_output directly versus being forwarded.
Cache the domain value in a local variable before the mbuf metadata is
overwritten to ensure the correct routing decision is made.
Fixes: e5570d2 ("policy: add stateful dynamic source nat support")
Signed-off-by: Robin Jarry <rjarry@redhat.com>1 parent 0a7d30c commit 8648af1
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
0 commit comments