LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [patch v2 08/12] [PATCH 08/12] IPVS: Add persistence engine data to

To: Simon Horman <horms@xxxxxxxxxxxx>
Subject: Re: [patch v2 08/12] [PATCH 08/12] IPVS: Add persistence engine data to /proc/net/ip_vs_conn
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Jan Engelhardt <jengelh@xxxxxxxxxx>, Stephen Hemminger <shemminger@xxxxxxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx>, Patrick McHardy <kaber@xxxxxxxxx>
From: Julian Anastasov <ja@xxxxxx>
Date: Sat, 2 Oct 2010 00:50:09 +0300 (EEST)

        Hello,

On Fri, 1 Oct 2010, Simon Horman wrote:

Index: lvs-test-2.6/net/netfilter/ipvs/ip_vs_conn.c
===================================================================
--- lvs-test-2.6.orig/net/netfilter/ipvs/ip_vs_conn.c   2010-10-01 
22:27:17.000000000 +0900
+++ lvs-test-2.6/net/netfilter/ipvs/ip_vs_conn.c        2010-10-01 
22:27:32.000000000 +0900
@@ -938,30 +938,44 @@ static int ip_vs_conn_seq_show(struct se

        if (v == SEQ_START_TOKEN)
                seq_puts(seq,
-   "Pro FromIP   FPrt ToIP     TPrt DestIP   DPrt State       Expires\n");
+   "Pro FromIP   FPrt ToIP     TPrt DestIP   DPrt State       Expires PEName 
PEData\n");
        else {
                const struct ip_vs_conn *cp = v;
+               char pe_data[IP_VS_PENAME_MAXLEN + IP_VS_PEDATA_MAXLEN + 3];
+               size_t len = 0;
+

        Add check for cp->dest, it is optional:

+               if (cp->dest->svc->pe && cp->dest->svc->pe->show_pe_data) {
+                       pe_data[0] = ' ';
+                       len = strlen(cp->dest->svc->pe->name);
+                       memcpy(pe_data + 1, cp->dest->svc->pe->name, len);
+                       pe_data[len + 1] = ' ';
+                       len += 2;
+                       len += cp->dest->svc->pe->show_pe_data(cp,
+                                                              pe_data + len);
+               }
+               pe_data[len] = '\0';

Regards

--
Julian Anastasov <ja@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>