LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[PATCH RFC 22/24] IPVS: Add IPv6 support to genetlink interface

To: netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx
Subject: [PATCH RFC 22/24] IPVS: Add IPv6 support to genetlink interface
Cc: horms@xxxxxxxxxxxx, kaber@xxxxxxxxx, vbusam@xxxxxxxxxx, Julius Volz <juliusv@xxxxxxxxxx>
From: Julius Volz <juliusv@xxxxxxxxxx>
Date: Wed, 20 Aug 2008 18:15:29 +0200
Allow adding IPv6 services in genetlink interface.

Signed-off-by: Julius Volz <juliusv@xxxxxxxxxx>

 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 73150ce..f2caf56 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -2565,7 +2565,7 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb,
        if (!nl_service)
                return -EMSGSIZE;
 
-       NLA_PUT_U16(skb, IPVS_SVC_ATTR_AF, AF_INET);
+       NLA_PUT_U16(skb, IPVS_SVC_ATTR_AF, svc->af);
 
        if (svc->fwmark) {
                NLA_PUT_U32(skb, IPVS_SVC_ATTR_FWMARK, svc->fwmark);
@@ -2671,8 +2671,12 @@ static int ip_vs_genl_parse_service(struct 
ip_vs_service_user *usvc,
        if (!(nla_af && (nla_fwmark || (nla_port && nla_protocol && nla_addr))))
                return -EINVAL;
 
-       /* For now, only support IPv4 */
-       if (nla_get_u16(nla_af) != AF_INET)
+       usvc->af = nla_get_u16(nla_af);
+#ifdef CONFIG_IP_VS_IPV6
+       if (usvc->af != AF_INET && usvc->af != AF_INET6)
+#else
+       if (usvc->af != AF_INET)
+#endif
                return -EAFNOSUPPORT;
 
        if (nla_fwmark) {
-- 
1.5.4.5

--
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>