diff options
Diffstat (limited to 'Swiften/Network/SolarisNetworkEnvironment.cpp')
-rw-r--r-- | Swiften/Network/SolarisNetworkEnvironment.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Swiften/Network/SolarisNetworkEnvironment.cpp b/Swiften/Network/SolarisNetworkEnvironment.cpp index 93eec32..c7d5c2d 100644 --- a/Swiften/Network/SolarisNetworkEnvironment.cpp +++ b/Swiften/Network/SolarisNetworkEnvironment.cpp @@ -2,15 +2,15 @@ * Copyright (c) 2011 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* -* Copyright (c) 2013-2014 Remko Tronçon and Kevin Smith -* Licensed under the GNU General Public License v3. -* See Documentation/Licenses/GPLv3.txt for more information. +* Copyright (c) 2013-2014 Isode Limited. +* All rights reserved.v3. +* See the COPYING file for more information. */ #include <Swiften/Network/SolarisNetworkEnvironment.h> #include <string> #include <vector> @@ -34,19 +34,19 @@ * Copyright (c) 2006 WIDE Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL @@ -134,21 +134,21 @@ static struct sockaddr * addrcpy(struct sockaddr_storage *addr, char **bufp) { char *buf = *bufp; size_t len; len = addr->ss_family == AF_INET ? sizeof (struct sockaddr_in) : - sizeof (struct sockaddr_in6); + sizeof (struct sockaddr_in6); (void) memcpy(buf, addr, len); *bufp = buf + len; return ((struct sockaddr *)buf); } static int populate(struct ifaddrs *ifa, int fd, struct lifreq *lifrp, int nlif, int af, - char **bufp) + char **bufp) { char *buf = *bufp; size_t slen; while (nlif > 0) { ifa->ifa_next = (nlif > 1) ? ifa + 1 : NULL; @@ -169,19 +169,19 @@ populate(struct ifaddrs *ifa, int fd, struct lifreq *lifrp, int nlif, int af, ifa->ifa_netmask = addrcpy(&lifrp->lifr_addr, &buf); if (ifa->ifa_flags & IFF_POINTOPOINT) { if (ioctl(fd, SIOCGLIFDSTADDR, lifrp) == -1) ifa->ifa_dstaddr = NULL; else ifa->ifa_dstaddr = - addrcpy(&lifrp->lifr_dstaddr, &buf); + addrcpy(&lifrp->lifr_dstaddr, &buf); } else if (ifa->ifa_flags & IFF_BROADCAST) { if (ioctl(fd, SIOCGLIFBRDADDR, lifrp) == -1) ifa->ifa_broadaddr = NULL; else ifa->ifa_broadaddr = - addrcpy(&lifrp->lifr_broadaddr, &buf); + addrcpy(&lifrp->lifr_broadaddr, &buf); } else { ifa->ifa_dstaddr = NULL; } ifa++; nlif--; @@ -201,28 +201,28 @@ getifaddrs(struct ifaddrs **ifap) struct ifaddrs *ifa = NULL; char *buf; if ((fd4 = socket(AF_INET, SOCK_DGRAM, 0)) == -1) return (-1); if ((fd6 = socket(AF_INET6, SOCK_DGRAM, 0)) == -1 && - errno != EAFNOSUPPORT) { + errno != EAFNOSUPPORT) { (void) close(fd4); return (-1); } if ((nif4 = get_lifreq(fd4, &ifr4)) == -1 || - (fd6 != -1 && (nif6 = get_lifreq(fd6, &ifr6)) == -1)) + (fd6 != -1 && (nif6 = get_lifreq(fd6, &ifr6)) == -1)) goto failure; if (nif4 == 0 && nif6 == 0) { *ifap = NULL; return (0); } ifa = (struct ifaddrs *) malloc(nbytes(ifr4, nif4, sizeof (struct sockaddr_in)) + - nbytes(ifr6, nif6, sizeof (struct sockaddr_in6))); + nbytes(ifr6, nif6, sizeof (struct sockaddr_in6))); if (ifa == NULL) goto failure; buf = (char *)(ifa + nif4 + nif6); if (populate(ifa, fd4, ifr4, nif4, AF_INET, &buf) == -1) |