rpcbind/0007-The-use-of-AI_NUMERICHOST-in-init_transport-is-broke.patch
Dirk Mueller 868d58656c Accepting request 215477 from home:okir:branches:network
- Fixed rpc broadcast handling (bnc#857324)
  Upgraded to upstream 0.2.1-rc4 as part of this, and rebased the
  patch set.

OBS-URL: https://build.opensuse.org/request/show/215477
OBS-URL: https://build.opensuse.org/package/show/network/rpcbind?expand=0&rev=32
2014-01-30 14:01:34 +00:00

50 lines
1.4 KiB
Diff

From 18c451ad482debbe7dab00699f4df8b075cee112 Mon Sep 17 00:00:00 2001
From: Olaf Kirch <okir@suse.de>
Date: Tue, 20 Aug 2013 09:12:49 +0200
Subject: [PATCH 07/24] The use of AI_NUMERICHOST in init_transport() is
broken.
In its current form, when seeing a dotted quad or a numeric IPv6 address,
it will clear all flags in hints.ai_flags (which has been set to AI_PASSIVE
a few lines above).
What this code should really be doing is to *set* AI_NUMERICHOST if and only
if it sees a numeric address.
Signed-off-by: Olaf Kirch <okir@suse.de>
---
src/rpcbind.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/rpcbind.c b/src/rpcbind.c
index f562f7a..896d509 100644
--- a/src/rpcbind.c
+++ b/src/rpcbind.c
@@ -365,11 +365,13 @@ init_transport(struct netconfig *nconf)
nconf->nc_netid);
return (1);
}
+
+ hints.ai_flags &= ~AI_NUMERICHOST;
switch (hints.ai_family) {
case AF_INET:
if (inet_pton(AF_INET, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET6 adress.
@@ -382,7 +384,7 @@ init_transport(struct netconfig *nconf)
case AF_INET6:
if (inet_pton(AF_INET6, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET adress.
--
1.7.12.4