Skip to contentSkip to conversation

ipvs: fix inability to remove a mixed-family RS

PATCH In review Alexey Andriyanov 3 participants 3 messages Feb 6, 2015 – Feb 9, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipvs: fix inability to remove a mixed-family RS

The current code prevents any operation with a mixed-family dest unless IP_VS_CONN_F_TUNNEL flag is set. The problem is that it's impossible for the client to follow this rule, because ip_vs_genl_parse_dest does not even read the destination conn_flags when cmd = IPVS_CMD_DEL_DEST (need_full_dest = 0).

Also, not every client can pass this flag when removing a dest. ipvsadm, for example, does not support the "-i" command line option together with the "-d" option.

This change disables any checks for mixed-family on IPVS_CMD_DEL_DEST command.

---
 net/netfilter/ipvs/ip_vs_ctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_ctl.c +1 -1
index ac7ba68..5b373c3 100644
@@ -3400,7 +3400,7 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
                if (udest.af == 0)
                        udest.af = svc->af;
 
-               if (udest.af != svc->af) {
+               if (udest.af != svc->af && cmd != IPVS_CMD_DEL_DEST) {
                        /* The synchronization protocol is incompatible
                         * with mixed family services
                         */
Signature · 1 line
1.7.9.5
maintainer Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 6 lines · Alexey Andriyanov

The current code prevents any operation with a mixed-family dest unless IP_VS_CONN_F_TUNNEL flag is set. The problem is that it's impossible for the client to follow this rule, because ip_vs_genl_parse_dest does not even read the destination conn_flags when cmd = IPVS_CMD_DEL_DEST (need_full_dest = 0).

Quoted 7 lines

Also, not every client can pass this flag when removing a dest. ipvsadm, for example, does not support the "-i" command line option together with the "-d" option.

This change disables any checks for mixed-family on IPVS_CMD_DEL_DEST command.

Good catch.

Fixes bc18d37f676f ("ipvs: Allow heterogeneous pools now that we support them")

Simon, please apply this bug fix.

Quoted 20 lines
---
 net/netfilter/ipvs/ip_vs_ctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_ctl.c +1 -1
index ac7ba68..5b373c3 100644
@@ -3400,7 +3400,7 @@ static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)
                if (udest.af == 0)
                        udest.af = svc->af;
 
-               if (udest.af != svc->af) {
+               if (udest.af != svc->af && cmd != IPVS_CMD_DEL_DEST) {
                        /* The synchronization protocol is incompatible
                         * with mixed family services
                         */
Signature · 1 line
1.7.9.5

Regards

--
Julian Anastasov <[email protected]>

maintainer
#2 lore raw
Quoted 17 lines · Julian Anastasov

Hello,

Quoted 12 lines · Alexey Andriyanov

The current code prevents any operation with a mixed-family dest unless IP_VS_CONN_F_TUNNEL flag is set. The problem is that it's impossible for the client to follow this rule, because ip_vs_genl_parse_dest does not even read the destination conn_flags when cmd = IPVS_CMD_DEL_DEST (need_full_dest = 0).

Also, not every client can pass this flag when removing a dest. ipvsadm, for example, does not support the "-i" command line option together with the "-d" option.

This change disables any checks for mixed-family on IPVS_CMD_DEL_DEST command.

Quoted 8 lines
Quoted 1 line

Good catch.

Fixes bc18d37f676f ("ipvs: Allow heterogeneous pools now that we support them")

Simon, please apply this bug fix.

Thanks, done.