lkml.org 
[lkml]   [1999]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fixes in Virtual Server for 2.2.12pre

Above is the patch against 2.2.12pre4/pre7 which fixes some
incompatibilities with masq tables changed in 2.2.11. Now VS works.

--- linux/include/net/ip_masq.h.orig Tue Aug 17 13:08:13 1999
+++ linux/include/net/ip_masq.h Tue Aug 17 13:08:55 1999
@@ -74,6 +74,7 @@

#ifdef __KERNEL__

+#define IP_MASQ_NTABLES 3
#define IP_MASQ_TAB_SIZE 16384

/*
--- linux/net/ipv4/ip_masq.c.orig Tue Aug 17 13:06:33 1999
+++ linux/net/ipv4/ip_masq.c Tue Aug 17 13:07:55 1999
@@ -599,8 +599,6 @@
* 1 for extra modules support (daddr)
*/

-#define IP_MASQ_NTABLES 3
-
struct list_head ip_masq_m_table[IP_MASQ_TAB_SIZE];
struct list_head ip_masq_s_table[IP_MASQ_TAB_SIZE];
struct list_head ip_masq_d_table[IP_MASQ_TAB_SIZE];
--- linux/net/ipv4/ip_vs.c.orig Sat Aug 14 15:03:58 1999
+++ linux/net/ipv4/ip_vs.c Tue Aug 17 13:45:47 1999
@@ -42,6 +42,7 @@
#include <net/ip.h>
#include <net/route.h>

+#include <net/ip_masq.h>
#include <net/ip_vs.h>

#ifdef CONFIG_KMOD
@@ -229,12 +230,12 @@
hash = ip_vs_hash_key(ms->protocol, ms->daddr, ms->dport);

/*
- * Note: because ip_masq_put sets masq expire if its refcnt==2,
- * we have to increase counter two times, otherwise the
- * masq won't expire.
+ * Note: because ip_masq_put sets masq expire if its
+ * refcnt==IP_MASQ_NTABLES, we have to increase
+ * counter IP_MASQ_NTABLES times, otherwise the masq
+ * won't expire.
*/
- atomic_inc(&ms->refcnt);
- atomic_inc(&ms->refcnt);
+ atomic_add(IP_MASQ_NTABLES, &ms->refcnt);
list_add(&ms->m_list, &ip_vs_table[hash]);

ms->flags |= IP_MASQ_F_HASHED;
@@ -250,7 +251,6 @@
int ip_vs_unhash(struct ip_masq *ms)
{
unsigned int hash;
- struct ip_masq ** ms_p;

if (!(ms->flags & IP_MASQ_F_HASHED)) {
IP_VS_ERR("ip_vs_unhash(): request for unhash flagged, called from %p\n",
@@ -262,11 +262,10 @@
*/
hash = ip_vs_hash_key(ms->protocol, ms->daddr, ms->dport);
/*
- * Note: since we increase refcnt twice while hashing,
- * we have to decrease it twice while unhashing.
+ * Note: since we increase refcnt while hashing,
+ * we have to decrease it while unhashing.
*/
- atomic_dec(&ms->refcnt);
- atomic_dec(&ms->refcnt);
+ atomic_sub(IP_MASQ_NTABLES, &ms->refcnt);
list_del(&ms->m_list);
ms->flags &= ~IP_MASQ_F_HASHED;
return 1;
@@ -284,7 +283,7 @@
struct ip_masq * ip_vs_in_get(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port)
{
unsigned hash;
- struct ip_masq *ms = NULL;
+ struct ip_masq *ms;
struct list_head *l, *e;

hash = ip_vs_hash_key(protocol, s_addr, s_port);
@@ -301,6 +300,7 @@
goto out;
}
}
+ ms = NULL;

out:
return ms;
@@ -317,7 +317,7 @@
struct ip_masq * ip_vs_out_get(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port)
{
unsigned hash;
- struct ip_masq *ms = NULL;
+ struct ip_masq *ms;
struct list_head *l, *e;

/*
@@ -338,6 +338,7 @@
}

}
+ ms = NULL;

out:
return ms;

Attached: gzipped variant

Julian Anastasov
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.034 / U:1.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site