~ubuntu-branches/ubuntu/trusty/ntp/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/isc/unix/interfaceiter.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-04-03 07:21:01 UTC
  • mfrom: (4.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20130403072101-v3vt8xcs18b6uhjf
Tags: 1:4.2.6.p5+dfsg-2ubuntu1
* New upstream version, fixing build failure in raring.
* Merge with Debian; remaining changes:
  + debian/ntp.conf, debian/ntpdate.default: Change default server to
    ntp.ubuntu.com.
  + debian/ntpdate.ifup: Stop ntp before running ntpdate when an interface
    comes up, then start again afterwards.
  + debian/ntp.init, debian/rules: Only stop when entering single user mode.
  + Add enforcing AppArmor profile:
    - debian/control: Add Conflicts/Replaces on apparmor-profiles.
    - debian/control: Add Suggests on apparmor.
    - debian/ntp.dirs: Add apparmor directories.
    - debian/ntp.preinst: Force complain on certain upgrades.
    - debian/ntp.postinst: Reload apparmor profile.
    - debian/ntp.postrm: Remove the force-complain file.
    - add debian/apparmor-profile*.
    - debian/rules: install apparmor-profile and apparmor-profile.tunable.
    - debian/README.Debian: Add note on AppArmor.
  + debian/{control,rules}: Add and enable hardened build for PIE.
  + debian/apparmor-profile: Adjust location of drift files.
  + debian/rules, debian/ntp.dirs, debian/source_ntp.py: Add apport hook.
  + debian/ntpdate-debian: Disregard empty ntp.conf files.
  + debian/ntp.preinst: Remove empty /etc/ntp.conf on fresh intallation.
  + debian/ntpdate.ifup: Fix interaction with openntpd.
  + debian/source_ntp.py: Add filter on AppArmor profile names to prevent
    false positives from denials originating in other packages.
  + debian/apparmor-profile: Add samba4 ntp signing socket to ntpd apparmor
    profile.
  + debian/apparmor-profile: adjust for IPv6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
#endif
52
52
#include <net/if.h>
53
53
 
 
54
#ifdef HAVE_LINUX_IF_ADDR_H
 
55
# include <linux/if_addr.h>
 
56
#endif
 
57
 
54
58
/* Common utility functions */
55
59
 
56
60
/*%
80
84
        switch (family) {
81
85
        case AF_INET:
82
86
                memcpy(&dst->type.in,
83
 
                       &((struct sockaddr_in *) src)->sin_addr,
 
87
                       &((struct sockaddr_in *)(void *)src)->sin_addr,
84
88
                       sizeof(struct in_addr));
85
89
                break;
86
90
        case AF_INET6:
87
 
                sa6 = (struct sockaddr_in6 *)src;
 
91
                sa6 = (struct sockaddr_in6 *)(void *)src;
88
92
                memcpy(&dst->type.in6, &sa6->sin6_addr,
89
93
                       sizeof(struct in6_addr));
90
94
#ifdef ISC_PLATFORM_HAVESCOPEID
217
221
                              "/proc/net/if_inet6:strlen(%s) != 32", address);
218
222
                return (ISC_R_FAILURE);
219
223
        }
 
224
        /*
 
225
        ** Ignore DAD addresses --
 
226
        ** we can't bind to them until they are resolved
 
227
        */
 
228
#ifdef IFA_F_TENTATIVE
 
229
        if (flags & IFA_F_TENTATIVE)
 
230
                return (ISC_R_IGNORE);
 
231
#endif
 
232
 
220
233
        for (i = 0; i < 16; i++) {
221
234
                unsigned char byte;
222
235
                static const char hex[] = "0123456789abcdef";