diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2015-04-13 07:34:57 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2015-04-13 07:34:57 +0200 |
commit | dd64f5afc19274f4e92afde3d13d1e8f0d2ee2d5 (patch) | |
tree | 4c5d9ae03a3d530f2f615229d9c726f4fd39ad98 /libc/inet/ifaddrs.c | |
parent | fe109717435b9e62e24579559b3bf521d047d453 (diff) | |
parent | a500a54bedc8081b9959cb03214047aead18b164 (diff) |
Merge branch '1.0' of git+ssh://uclibc-ng.org/git/uclibc-ng into 1.0
Diffstat (limited to 'libc/inet/ifaddrs.c')
-rw-r--r-- | libc/inet/ifaddrs.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c index 6d9ee8903..0c9310651 100644 --- a/libc/inet/ifaddrs.c +++ b/libc/inet/ifaddrs.c @@ -115,7 +115,8 @@ __netlink_request (struct netlink_handle *h, int type) { struct netlink_res *nlm_next; struct netlink_res **new_nlm_list; - static volatile size_t buf_size = 4096; + static volatile size_t buf_size = 0; + size_t this_buf_size; char *buf; struct sockaddr_nl nladdr; struct nlmsghdr *nlmh; @@ -126,7 +127,15 @@ __netlink_request (struct netlink_handle *h, int type) if (__netlink_sendreq (h, type) < 0) return -1; - size_t this_buf_size = buf_size; + if (buf_size) + this_buf_size = buf_size; + else { +#ifdef PAGE_SIZE + this_buf_size = PAGE_SIZE; +#else + this_buf_size = __pagesize; +#endif + } if (__libc_use_alloca (this_buf_size)) buf = alloca (this_buf_size); else |