[fedfs-utils] [PATCH 2/3] libsi: Handle multiple records in an SRV reply
Chuck Lever
chuck.lever at oracle.com
Mon Oct 7 09:36:14 PDT 2013
getservinfo() incorrectly returns ESI_PARSE when a domain has
multiple SRV records. After each record in the buffer is parsed,
"comp_dn" was not being incremented correctly. Only the first
record was parsed correctly.
Introduced by commit 0520ee72, "Initial commit," Mar 29 15:37:40
2011.
Signed-off-by: Chuck Lever <chuck.lever at oracle.com>
---
src/libsi/getsrvinfo.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libsi/getsrvinfo.c b/src/libsi/getsrvinfo.c
index 931847e..c0f433f 100644
--- a/src/libsi/getsrvinfo.c
+++ b/src/libsi/getsrvinfo.c
@@ -265,16 +265,17 @@ getsrvinfo(const char *srvname, const char *domainname, struct srvinfo **si)
status = ESI_PARSE;
goto out_free;
}
-
comp_dn += l;
record = (struct srv *)&comp_dn[10];
+ comp_dn += 16;
- l = dn_expand(msg, msg + len, comp_dn + 16, exp_dn, NS_MAXDNAME);
+ l = dn_expand(msg, msg + len, comp_dn, exp_dn, NS_MAXDNAME);
if (l == -1) {
status = ESI_PARSE;
goto out_free;
}
+ comp_dn += l;
if (count == 1 && strcmp(exp_dn, ".") == 0) {
status = ESI_SERVICE;
More information about the fedfs-utils-devel
mailing list