~ubuntu-branches/debian/jessie/nfs-utils/jessie

« back to all changes in this revision

Viewing changes to support/include/sockaddr.h

  • Committer: Stéphane Graber
  • Author(s): Luk Claes
  • Date: 2013-05-10 19:27:47 UTC
  • mfrom: (1.2.23)
  • Revision ID: stgraber@ubuntu.com-20130510192747-cmt3wre21m3aje04
Tags: 1:1.2.8-1
* New upstream version (Closes: #707258).
  - Only amend extra-options on a successful vers=4 mount
    (Closes: #690181).
  - Use default domain (Closes: #657188).
  - Fix is-subdirectory to understand '/' (Closes: #685306).
  - Drop 18-osd_login-sbindir: incorporated upstream.
  - Avoid DNS reverse lookups on server names (Closes: #707401).
  - auth_unix_ip should downcall on error (Closes: #682709).
  - Refresh 11-532048-reduce-verbosity.
* Use rpcbind's rpcinfo everywhere (Closes: #707589).
* Add nfsdcltrack to nfs-kernel-server.
* Add libsqlite3-dev build dependency for nfsdcltrack.
* Do not try to install dropped ChangeLog.
* Adjust version of replaces due to manpage move.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef NFS_UTILS_SOCKADDR_H
21
21
#define NFS_UTILS_SOCKADDR_H
22
22
 
 
23
#ifdef HAVE_CONFIG_H
 
24
#include <config.h>
 
25
#endif
 
26
 
 
27
#ifdef HAVE_LIBIO_H
23
28
#include <libio.h>
 
29
#endif
24
30
#include <stdbool.h>
25
31
#include <sys/socket.h>
26
32
#include <netinet/in.h>
193
199
{
194
200
        const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sa1;
195
201
        const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sa2;
 
202
        const struct in6_addr *saddr1 = &sin1->sin6_addr;
 
203
        const struct in6_addr *saddr2 = &sin2->sin6_addr;
196
204
 
197
 
        if ((IN6_IS_ADDR_LINKLOCAL((char *)&sin1->sin6_addr) &&
198
 
             IN6_IS_ADDR_LINKLOCAL((char *)&sin2->sin6_addr)) ||
199
 
            (IN6_IS_ADDR_SITELOCAL((char *)&sin1->sin6_addr) &&
200
 
             IN6_IS_ADDR_SITELOCAL((char *)&sin2->sin6_addr)))
 
205
        if (IN6_IS_ADDR_LINKLOCAL(saddr1) && IN6_IS_ADDR_LINKLOCAL(saddr2))
201
206
                if (sin1->sin6_scope_id != sin2->sin6_scope_id)
202
207
                        return false;
203
208
 
204
 
        return IN6_ARE_ADDR_EQUAL((char *)&sin1->sin6_addr,
205
 
                                        (char *)&sin2->sin6_addr);
 
209
        return IN6_ARE_ADDR_EQUAL(saddr1, saddr2);
206
210
}
207
211
#else   /* !IPV6_SUPPORTED */
208
212
static inline _Bool