diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-04-12 10:10:25 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-04-12 09:26:25 -0400 |
commit | 655ae41e718c8f6de4338293ce74098bb72546bf (patch) | |
tree | 8c16fe42c2b3fd3f2da60e25d6c63fb6791b1f12 /src/resolv | |
parent | 41019c25edfef1b37e0ff6a9b505061a04fcff84 (diff) | |
download | sssd-655ae41e718c8f6de4338293ce74098bb72546bf.tar.gz sssd-655ae41e718c8f6de4338293ce74098bb72546bf.tar.bz2 sssd-655ae41e718c8f6de4338293ce74098bb72546bf.zip |
Use safe alignment macros for in-tree SRV record parsing
The in-tree SRV record parsing is used with very old c-ares libraries
that don't implement the parsing themselves (c-ares < 1.7, used in e.g.
RHEL5)
Diffstat (limited to 'src/resolv')
-rw-r--r-- | src/resolv/ares/ares_parse_srv_reply.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/resolv/ares/ares_parse_srv_reply.c b/src/resolv/ares/ares_parse_srv_reply.c index 086c4dba..7e01e1a6 100644 --- a/src/resolv/ares/ares_parse_srv_reply.c +++ b/src/resolv/ares/ares_parse_srv_reply.c @@ -143,11 +143,11 @@ int _ares_parse_srv_reply (const unsigned char *abuf, int alen, srv_last = srv_curr; vptr = aptr; - srv_curr->priority = ntohs (*((const unsigned short *)vptr)); + srv_curr->priority = DNS__16BIT(vptr); vptr += sizeof(const unsigned short); - srv_curr->weight = ntohs (*((const unsigned short *)vptr)); + srv_curr->weight = DNS__16BIT(vptr); vptr += sizeof(const unsigned short); - srv_curr->port = ntohs (*((const unsigned short *)vptr)); + srv_curr->port = DNS__16BIT(vptr); vptr += sizeof(const unsigned short); status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len); |