patch-pre2.0.9 linux/net/ipv4/ip_fw.c

Next file: linux/Documentation/ioctl-number.txt
Previous file: linux/mm/swapfile.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.8/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
@@ -541,7 +541,13 @@
 #ifdef CONFIG_IP_TRANSPARENT_PROXY
 			if (policy&IP_FW_F_REDIR) {
 				if (redirport)
-					*redirport = htons(f->fw_pts[f->fw_nsp+f->fw_ndp]);
+					if ((*redirport = htons(f->fw_pts[f->fw_nsp+f->fw_ndp])) == 0) {
+						/* Wildcard redirection.
+						 * Note that redirport will become
+						 * 0xFFFF for non-TCP/UDP packets.
+						 */
+						*redirport = dst_port;
+					}
 				answer = FW_REDIRECT;
 			} else
 #endif


FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this