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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Julius Volz
Date: Wednesday, August 20, 2008 - 9:15 am

Allow adding IPv6 services in genetlink interface.

Signed-off-by: Julius Volz <juliusv@google.com>

 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 netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC 00/24] IPVS: Add first IPv6 support to IPVS, Julius Volz, (Wed Aug 20, 9:15 am)
[PATCH RFC 11/24] IPVS: Add IPv6 xmit functions, Julius Volz, (Wed Aug 20, 9:15 am)
[PATCH RFC 22/24] IPVS: Add IPv6 support to genetlink inte ..., Julius Volz, (Wed Aug 20, 9:15 am)
[PATCH RFC 23/24] IPVS: Small address/af usage fixups, Julius Volz, (Wed Aug 20, 9:15 am)
[PATCH RFC 24/24] IPVS: Add notes about IPv6 changes, Julius Volz, (Wed Aug 20, 9:15 am)
Re: [PATCH RFC 00/24] IPVS: Add first IPv6 support to IPVS, Joseph Mack NA3T, (Sat Aug 23, 8:22 am)
Re: [PATCH RFC 00/24] IPVS: Add first IPv6 support to IPVS, Joseph Mack NA3T, (Sat Aug 23, 6:40 pm)
Re: [PATCH RFC 00/24] IPVS: Add first IPv6 support to IPVS, Joseph Mack NA3T, (Sat Aug 23, 7:13 pm)