Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421491

[PATCH 3/5] ipvs: Don't check result < 0 after setting result = 0

From Quentin Armitage <quentin@armitage.org.uk>
Newsgroups linux.kernel
Subject [PATCH 3/5] ipvs: Don't check result < 0 after setting result = 0
Date 2016-06-14 04:00 +0200
Message-ID <rJLO2-6jG-9@gated-at.bofh.it> (permalink)
References <rJLO1-6jG-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Move the block testing result < 0 to avoid the test immediately
after setting result = 0

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
---
 net/netfilter/ipvs/ip_vs_sync.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 3181fd0..29d73d8 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1497,13 +1497,13 @@ static struct socket *make_send_sock(struct netns_ipvs *ipvs, int id, struct net
 			  ipvs->mcast_ifn, &addr);
 
 		result = bind_mcastif_addr(sock, dev);
+		if (result < 0) {
+			pr_err("Error binding address of the mcast interface\n");
+			goto error;
+		}
 	}
 	else
 		result = 0;
-	if (result < 0) {
-		pr_err("Error binding address of the mcast interface\n");
-		goto error;
-	}
 
 	get_mcast_sockaddr(&mcast_addr, &salen, &ipvs->mcfg, id);
 	result = sock->ops->connect(sock, (struct sockaddr *) &mcast_addr,
-- 
1.7.7.6

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] ipvs: fix backup sync daemon with IPv6, and minor updates Quentin Armitage <quentin@armitage.org.uk> - 2016-06-14 04:00 +0200
  [PATCH 3/5] ipvs: Don't check result < 0 after setting result = 0 Quentin Armitage <quentin@armitage.org.uk> - 2016-06-14 04:00 +0200
  [PATCH 2/5] ipvs: Stop calling __dev_get_by_name() repeatedly when starting sync daemon Quentin Armitage <quentin@armitage.org.uk> - 2016-06-14 04:00 +0200
  [PATCH 4/5] ipvs: Lock socket before setting SK_CAN_REUSE Quentin Armitage <quentin@armitage.org.uk> - 2016-06-14 04:00 +0200
    Re: [PATCH 4/5] ipvs: Lock socket before setting SK_CAN_REUSE Eric Dumazet <eric.dumazet@gmail.com> - 2016-06-14 05:20 +0200
    Re: [PATCH 4/5] ipvs: Lock socket before setting SK_CAN_REUSE Eric Dumazet <eric.dumazet@gmail.com> - 2016-06-14 05:20 +0200
  [PATCH 5/5] ipvs: log additional sync daemon parameters Quentin Armitage <quentin@armitage.org.uk> - 2016-06-14 04:00 +0200
  [PATCH 1/5] ipvs: Enable setting IPv6 multicast address for ipvs sync daemon backup Quentin Armitage <quentin@armitage.org.uk> - 2016-06-14 04:00 +0200

csiph-web