From ce39c134129e70c4783042ba1b7af779b4ed3491 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 9 Apr 2000 21:05:23 +0000 Subject: [PATCH] (find_all_addresses): apperently solaris can return EINVAL when the buffer is too small. cope. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8161 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/get_addrs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/krb5/get_addrs.c b/lib/krb5/get_addrs.c index 4e682c538..f82c7d0dc 100644 --- a/lib/krb5/get_addrs.c +++ b/lib/krb5/get_addrs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -129,7 +129,11 @@ find_all_addresses (krb5_context context, } ifconf.ifc_len = buf_size; ifconf.ifc_buf = buf; - if (ioctl (fd, siocgifconf, &ifconf) < 0) { + + /* + * Solaris returns EINVAL when the buffer is too small. + */ + if (ioctl (fd, siocgifconf, &ifconf) < 0 && errno != EINVAL) { ret = errno; goto error_out; } @@ -290,7 +294,7 @@ get_addrs_int (krb5_context context, krb5_addresses *res, int flags) krb5_error_code krb5_get_all_client_addrs (krb5_context context, krb5_addresses *res) { - int flags = LOOP_IF_NONE | EXTRA_ADDRESSES; + int flags = LOOP | EXTRA_ADDRESSES; if (context->scan_interfaces) flags |= SCAN_INTERFACES;