along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <limits.h>
#include <nss.h>
-#include <sys/types.h>
#include <netdb.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
-#include <net/if.h>
#include <stdlib.h>
-#include <arpa/inet.h>
#include <dlfcn.h>
#include "sd-bus.h"
#include "bus-util.h"
-#include "bus-errors.h"
+#include "bus-common-errors.h"
#include "macro.h"
#include "nss-util.h"
#include "util.h"
alen = FAMILY_ADDRESS_SIZE(af);
l = strlen(canonical);
- ms = ALIGN(l+1) +
- sizeof(char*) +
- (c > 0 ? c : 1) * ALIGN(alen) +
- (c > 0 ? c+1 : 2) * sizeof(char*);
+ ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*);
if (buflen < ms) {
*errnop = ENOMEM;
goto fail;
}
- if (ifindex < 0) {
- r = -EINVAL;
- goto fail;
- }
-
memcpy(r_addr + i*ALIGN(alen), a, alen);
i++;
}