[Olsr-dev] [PATCH v1 094/115] info: plugin_ipc_init: merge 2 if statements
Ferry Huberts
(spam-protected)
Wed Dec 2 21:29:07 CET 2015
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
lib/info/olsrd_info.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index cfb4858..2e6d322 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -396,14 +396,12 @@ static int plugin_ipc_init(void) {
#endif /* (defined __FreeBSD__ || defined __FreeBSD_kernel__) && defined SO_NOSIGPIPE */
#if defined linux && defined IPV6_V6ONLY
- if (config->ipv6_only && olsr_cnf->ip_version == AF_INET6) {
- if (setsockopt(ipc_socket, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &yes, sizeof(yes)) < 0) {
- perror("IPV6_V6ONLY failed");
- goto error_out;
- }
+ if (config->ipv6_only && (olsr_cnf->ip_version == AF_INET6) //
+ && (setsockopt(ipc_socket, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &yes, sizeof(yes)) < 0)) {
+ perror("IPV6_V6ONLY failed");
+ goto error_out;
}
#endif /* defined linux && defined IPV6_V6ONLY */
- /* Bind the socket */
/* complete the socket structure */
memset(&sock_addr, 0, sizeof(sock_addr));
--
2.5.0
More information about the Olsr-dev
mailing list