--- linux-2.4.0/net/ipv4/netfilter/ip_fw_compat.c.orig	Tue Sep 19 06:09:55 2000
+++ linux-2.4.0/net/ipv4/netfilter/ip_fw_compat.c	Fri Jan 26 00:57:21 2001
@@ -46,6 +46,10 @@
 extern int __init masq_init(void);
 extern void masq_cleanup(void);
 
+/* From ip_vs_core.c */
+extern unsigned int
+check_for_ip_vs_out(struct sk_buff **skb_p, int (*okfn)(struct sk_buff *));
+
 /* They call these; we do what they want. */
 int register_firewall(int pf, struct firewall_ops *fw)
 {
@@ -172,8 +176,14 @@
 		return NF_ACCEPT;
 
 	case FW_MASQUERADE:
-		if (hooknum == NF_IP_FORWARD)
+		if (hooknum == NF_IP_FORWARD) {
+#ifdef CONFIG_IP_VS
+                        /* check if it is for ip_vs */
+                        if (check_for_ip_vs_out(pskb, okfn) == NF_STOLEN)
+                                return NF_STOLEN;
+#endif
 			return do_masquerade(pskb, out);
+                }
 		else return NF_ACCEPT;
 
 	case FW_REDIRECT:
