aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2010-08-22 08:37:53 -0400
committerSimon Horman <horms@verge.net.au>2010-10-04 09:45:24 -0400
commita3c918acd29a96aba3b46bf50136e7953a480d17 (patch)
tree570a5ea3a3fdef62b86e944ebcfcaf8b88ddb735 /net
parent85999283a21ab2dd37427fdd8c8e8af57223977c (diff)
IPVS: Add persistence engine data to /proc/net/ip_vs_conn
This shouldn't break compatibility with userspace as the new data is at the end of the line. I have confirmed that this doesn't break ipvsadm, the main (only?) user-space user of this data. Signed-off-by: Simon Horman <horms@verge.net.au> Acked-by: Julian Anastasov <ja@ssi.bg>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/ipvs/ip_vs_conn.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 06da21e97405..4adedefdf563 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -950,30 +950,45 @@ static int ip_vs_conn_seq_show(struct seq_file *seq, void *v)
950 950
951 if (v == SEQ_START_TOKEN) 951 if (v == SEQ_START_TOKEN)
952 seq_puts(seq, 952 seq_puts(seq,
953 "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires\n"); 953 "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires PEName PEData\n");
954 else { 954 else {
955 const struct ip_vs_conn *cp = v; 955 const struct ip_vs_conn *cp = v;
956 char pe_data[IP_VS_PENAME_MAXLEN + IP_VS_PEDATA_MAXLEN + 3];
957 size_t len = 0;
958
959 if (cp->dest && cp->dest->svc->pe &&
960 cp->dest->svc->pe->show_pe_data) {
961 pe_data[0] = ' ';
962 len = strlen(cp->dest->svc->pe->name);
963 memcpy(pe_data + 1, cp->dest->svc->pe->name, len);
964 pe_data[len + 1] = ' ';
965 len += 2;
966 len += cp->dest->svc->pe->show_pe_data(cp,
967 pe_data + len);
968 }
969 pe_data[len] = '\0';
956 970
957#ifdef CONFIG_IP_VS_IPV6 971#ifdef CONFIG_IP_VS_IPV6
958 if (cp->af == AF_INET6) 972 if (cp->af == AF_INET6)
959 seq_printf(seq, "%-3s %pI6 %04X %pI6 %04X %pI6 %04X %-11s %7lu\n", 973 seq_printf(seq, "%-3s %pI6 %04X %pI6 %04X "
974 "%pI6 %04X %-11s %7lu%s\n",
960 ip_vs_proto_name(cp->protocol), 975 ip_vs_proto_name(cp->protocol),
961 &cp->caddr.in6, ntohs(cp->cport), 976 &cp->caddr.in6, ntohs(cp->cport),
962 &cp->vaddr.in6, ntohs(cp->vport), 977 &cp->vaddr.in6, ntohs(cp->vport),
963 &cp->daddr.in6, ntohs(cp->dport), 978 &cp->daddr.in6, ntohs(cp->dport),
964 ip_vs_state_name(cp->protocol, cp->state), 979 ip_vs_state_name(cp->protocol, cp->state),
965 (cp->timer.expires-jiffies)/HZ); 980 (cp->timer.expires-jiffies)/HZ, pe_data);
966 else 981 else
967#endif 982#endif
968 seq_printf(seq, 983 seq_printf(seq,
969 "%-3s %08X %04X %08X %04X" 984 "%-3s %08X %04X %08X %04X"
970 " %08X %04X %-11s %7lu\n", 985 " %08X %04X %-11s %7lu%s\n",
971 ip_vs_proto_name(cp->protocol), 986 ip_vs_proto_name(cp->protocol),
972 ntohl(cp->caddr.ip), ntohs(cp->cport), 987 ntohl(cp->caddr.ip), ntohs(cp->cport),
973 ntohl(cp->vaddr.ip), ntohs(cp->vport), 988 ntohl(cp->vaddr.ip), ntohs(cp->vport),
974 ntohl(cp->daddr.ip), ntohs(cp->dport), 989 ntohl(cp->daddr.ip), ntohs(cp->dport),
975 ip_vs_state_name(cp->protocol, cp->state), 990 ip_vs_state_name(cp->protocol, cp->state),
976 (cp->timer.expires-jiffies)/HZ); 991 (cp->timer.expires-jiffies)/HZ, pe_data);
977 } 992 }
978 return 0; 993 return 0;
979} 994}