diff options
author | Vince Busam <vbusam@google.com> | 2008-09-02 09:55:49 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2008-09-04 21:17:10 -0400 |
commit | 667a5f18162e803e30722af46ade1737e3b93198 (patch) | |
tree | 28708212c9d8b2a19006c4745fdffda3f9dca83f /net | |
parent | 7937df1564783806c285d34a1c6fd63d8da29d7a (diff) |
IPVS: Convert procfs files for IPv6 entry output
Correctly output IPv6 connection/service/dest entries in procfs files.
Signed-off-by: Vince Busam <vbusam@google.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_conn.c | 37 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 54 |
2 files changed, 73 insertions, 18 deletions
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index c2a42a62433b..e7603d749c09 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
@@ -815,8 +815,22 @@ static int ip_vs_conn_seq_show(struct seq_file *seq, void *v) | |||
815 | else { | 815 | else { |
816 | const struct ip_vs_conn *cp = v; | 816 | const struct ip_vs_conn *cp = v; |
817 | 817 | ||
818 | seq_printf(seq, | 818 | #ifdef CONFIG_IP_VS_IPV6 |
819 | "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu\n", | 819 | if (cp->af == AF_INET6) |
820 | seq_printf(seq, | ||
821 | "%-3s " NIP6_FMT " %04X " NIP6_FMT | ||
822 | " %04X " NIP6_FMT " %04X %-11s %7lu\n", | ||
823 | ip_vs_proto_name(cp->protocol), | ||
824 | NIP6(cp->caddr.in6), ntohs(cp->cport), | ||
825 | NIP6(cp->vaddr.in6), ntohs(cp->vport), | ||
826 | NIP6(cp->daddr.in6), ntohs(cp->dport), | ||
827 | ip_vs_state_name(cp->protocol, cp->state), | ||
828 | (cp->timer.expires-jiffies)/HZ); | ||
829 | else | ||
830 | #endif | ||
831 | seq_printf(seq, | ||
832 | "%-3s %08X %04X %08X %04X" | ||
833 | " %08X %04X %-11s %7lu\n", | ||
820 | ip_vs_proto_name(cp->protocol), | 834 | ip_vs_proto_name(cp->protocol), |
821 | ntohl(cp->caddr.ip), ntohs(cp->cport), | 835 | ntohl(cp->caddr.ip), ntohs(cp->cport), |
822 | ntohl(cp->vaddr.ip), ntohs(cp->vport), | 836 | ntohl(cp->vaddr.ip), ntohs(cp->vport), |
@@ -864,8 +878,23 @@ static int ip_vs_conn_sync_seq_show(struct seq_file *seq, void *v) | |||
864 | else { | 878 | else { |
865 | const struct ip_vs_conn *cp = v; | 879 | const struct ip_vs_conn *cp = v; |
866 | 880 | ||
867 | seq_printf(seq, | 881 | #ifdef CONFIG_IP_VS_IPV6 |
868 | "%-3s %08X %04X %08X %04X %08X %04X %-11s %-6s %7lu\n", | 882 | if (cp->af == AF_INET6) |
883 | seq_printf(seq, | ||
884 | "%-3s " NIP6_FMT " %04X " NIP6_FMT | ||
885 | " %04X " NIP6_FMT " %04X %-11s %-6s %7lu\n", | ||
886 | ip_vs_proto_name(cp->protocol), | ||
887 | NIP6(cp->caddr.in6), ntohs(cp->cport), | ||
888 | NIP6(cp->vaddr.in6), ntohs(cp->vport), | ||
889 | NIP6(cp->daddr.in6), ntohs(cp->dport), | ||
890 | ip_vs_state_name(cp->protocol, cp->state), | ||
891 | ip_vs_origin_name(cp->flags), | ||
892 | (cp->timer.expires-jiffies)/HZ); | ||
893 | else | ||
894 | #endif | ||
895 | seq_printf(seq, | ||
896 | "%-3s %08X %04X %08X %04X " | ||
897 | "%08X %04X %-11s %-6s %7lu\n", | ||
869 | ip_vs_proto_name(cp->protocol), | 898 | ip_vs_proto_name(cp->protocol), |
870 | ntohl(cp->caddr.ip), ntohs(cp->cport), | 899 | ntohl(cp->caddr.ip), ntohs(cp->cport), |
871 | ntohl(cp->vaddr.ip), ntohs(cp->vport), | 900 | ntohl(cp->vaddr.ip), ntohs(cp->vport), |
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index bb0e1e3c8857..25d9e98e31fa 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -1793,15 +1793,25 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) | |||
1793 | const struct ip_vs_iter *iter = seq->private; | 1793 | const struct ip_vs_iter *iter = seq->private; |
1794 | const struct ip_vs_dest *dest; | 1794 | const struct ip_vs_dest *dest; |
1795 | 1795 | ||
1796 | if (iter->table == ip_vs_svc_table) | 1796 | if (iter->table == ip_vs_svc_table) { |
1797 | seq_printf(seq, "%s %08X:%04X %s ", | 1797 | #ifdef CONFIG_IP_VS_IPV6 |
1798 | ip_vs_proto_name(svc->protocol), | 1798 | if (svc->af == AF_INET6) |
1799 | ntohl(svc->addr.ip), | 1799 | seq_printf(seq, "%s [" NIP6_FMT "]:%04X %s ", |
1800 | ntohs(svc->port), | 1800 | ip_vs_proto_name(svc->protocol), |
1801 | svc->scheduler->name); | 1801 | NIP6(svc->addr.in6), |
1802 | else | 1802 | ntohs(svc->port), |
1803 | svc->scheduler->name); | ||
1804 | else | ||
1805 | #endif | ||
1806 | seq_printf(seq, "%s %08X:%04X %s ", | ||
1807 | ip_vs_proto_name(svc->protocol), | ||
1808 | ntohl(svc->addr.ip), | ||
1809 | ntohs(svc->port), | ||
1810 | svc->scheduler->name); | ||
1811 | } else { | ||
1803 | seq_printf(seq, "FWM %08X %s ", | 1812 | seq_printf(seq, "FWM %08X %s ", |
1804 | svc->fwmark, svc->scheduler->name); | 1813 | svc->fwmark, svc->scheduler->name); |
1814 | } | ||
1805 | 1815 | ||
1806 | if (svc->flags & IP_VS_SVC_F_PERSISTENT) | 1816 | if (svc->flags & IP_VS_SVC_F_PERSISTENT) |
1807 | seq_printf(seq, "persistent %d %08X\n", | 1817 | seq_printf(seq, "persistent %d %08X\n", |
@@ -1811,13 +1821,29 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v) | |||
1811 | seq_putc(seq, '\n'); | 1821 | seq_putc(seq, '\n'); |
1812 | 1822 | ||
1813 | list_for_each_entry(dest, &svc->destinations, n_list) { | 1823 | list_for_each_entry(dest, &svc->destinations, n_list) { |
1814 | seq_printf(seq, | 1824 | #ifdef CONFIG_IP_VS_IPV6 |
1815 | " -> %08X:%04X %-7s %-6d %-10d %-10d\n", | 1825 | if (dest->af == AF_INET6) |
1816 | ntohl(dest->addr.ip), ntohs(dest->port), | 1826 | seq_printf(seq, |
1817 | ip_vs_fwd_name(atomic_read(&dest->conn_flags)), | 1827 | " -> [" NIP6_FMT "]:%04X" |
1818 | atomic_read(&dest->weight), | 1828 | " %-7s %-6d %-10d %-10d\n", |
1819 | atomic_read(&dest->activeconns), | 1829 | NIP6(dest->addr.in6), |
1820 | atomic_read(&dest->inactconns)); | 1830 | ntohs(dest->port), |
1831 | ip_vs_fwd_name(atomic_read(&dest->conn_flags)), | ||
1832 | atomic_read(&dest->weight), | ||
1833 | atomic_read(&dest->activeconns), | ||
1834 | atomic_read(&dest->inactconns)); | ||
1835 | else | ||
1836 | #endif | ||
1837 | seq_printf(seq, | ||
1838 | " -> %08X:%04X " | ||
1839 | "%-7s %-6d %-10d %-10d\n", | ||
1840 | ntohl(dest->addr.ip), | ||
1841 | ntohs(dest->port), | ||
1842 | ip_vs_fwd_name(atomic_read(&dest->conn_flags)), | ||
1843 | atomic_read(&dest->weight), | ||
1844 | atomic_read(&dest->activeconns), | ||
1845 | atomic_read(&dest->inactconns)); | ||
1846 | |||
1821 | } | 1847 | } |
1822 | } | 1848 | } |
1823 | return 0; | 1849 | return 0; |