diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-05-06 18:04:35 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-05-06 18:04:35 +0000 |
commit | bce16467708a050e1c88a010f7dfb370013e5ea6 (patch) | |
tree | 250bdd8bc2d735f826ee108b75554d2586bdf3d4 /include/arpa | |
parent | 8e45b1acc235d73fc6866849ec302e9c2077a84e (diff) | |
download | glibc-bce16467708a050e1c88a010f7dfb370013e5ea6.zip glibc-bce16467708a050e1c88a010f7dfb370013e5ea6.tar.gz glibc-bce16467708a050e1c88a010f7dfb370013e5ea6.tar.bz2 |
* include/arpa/nameser.h: Also optimize NS_PUT16 and NS_PUT32.
* resolv/res_mkquery.c: Use NS_PUT16 and NS_PUT32 instead of __putshort
and __putlong respectively. Correct buffer overflow check for
NS_NOTIFY_OP.
* resolv/res_send.c (send_vc): Use ns_put16 instead of putshort.
Diffstat (limited to 'include/arpa')
-rw-r--r-- | include/arpa/nameser.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index 09bd504..449f5b4 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -18,10 +18,26 @@ } while (0) # undef NS_GET32 -# define NS_GET32(s, cp) \ +# define NS_GET32(l, cp) \ do { \ uint32_t *t_cp = (uint32_t *) (cp); \ - (s) = ntohl (*t_cp); \ + (l) = ntohl (*t_cp); \ + (cp) += NS_INT32SZ; \ + } while (0) + +# undef NS_PUT16 +# define NS_PUT16(s, cp) \ + do { \ + uint16_t *t_cp = (uint16_t *) (cp); \ + *t_cp = htons (s); \ + (cp) += NS_INT16SZ; \ + } while (0) + +# undef NS_PUT32 +# define NS_PUT32(l, cp) \ + do { \ + uint32_t *t_cp = (uint32_t *) (cp); \ + *t_cp = htonl (l); \ (cp) += NS_INT32SZ; \ } while (0) |