1 Index: uclibc/libc/inet/ifaddrs.c
2 ===================================================================
3 --- uclibc.orig/libc/inet/ifaddrs.c
4 +++ uclibc/libc/inet/ifaddrs.c
8 #include "netlinkaccess.h"
11 libc_hidden_proto(socket)
12 libc_hidden_proto(close)
13 @@ -57,7 +58,6 @@ libc_hidden_proto(abort)
16 #if __ASSUME_NETLINK_SUPPORT
17 -#if 0 /* unused code */
18 /* struct to hold the data for one ifaddrs entry, so we can allocate
19 everything at once. */
20 struct ifaddrs_storage
21 @@ -74,8 +74,6 @@ struct ifaddrs_storage
22 } addr, netmask, broadaddr;
23 char name[IF_NAMESIZE + 1];
25 -#endif /* unused code */
29 __netlink_free_handle (struct netlink_handle *h)
30 @@ -323,8 +321,6 @@ __netlink_open (struct netlink_handle *h
35 -#if 0 /* unused code */
36 /* We know the number of RTM_NEWLINK entries, so we reserve the first
37 # of entries for this type. All RTM_NEWADDR entries have an index
38 pointer to the RTM_NEWLINK entry. To find the entry, create
39 @@ -562,7 +558,7 @@ getifaddrs (struct ifaddrs **ifap)
40 if ((rta_payload + 1) <= sizeof (ifas[ifa_index].name))
42 ifas[ifa_index].ifa.ifa_name = ifas[ifa_index].name;
43 - *(char *) __mempcpy (ifas[ifa_index].name, rta_data,
44 + *(char *) mempcpy (ifas[ifa_index].name, rta_data,
48 @@ -761,7 +757,7 @@ getifaddrs (struct ifaddrs **ifap)
49 if (rta_payload + 1 <= sizeof (ifas[ifa_index].name))
51 ifas[ifa_index].ifa.ifa_name = ifas[ifa_index].name;
52 - *(char *) __mempcpy (ifas[ifa_index].name, rta_data,
53 + *(char *) mempcpy (ifas[ifa_index].name, rta_data,
57 @@ -872,6 +868,4 @@ freeifaddrs (struct ifaddrs *ifa)
61 -#endif /* unused code */
63 #endif /* __ASSUME_NETLINK_SUPPORT */
64 Index: uclibc/libc/inet/netlinkaccess.h
65 ===================================================================
66 --- uclibc.orig/libc/inet/netlinkaccess.h
67 +++ uclibc/libc/inet/netlinkaccess.h
68 @@ -61,14 +61,11 @@ struct netlink_handle
72 -#if 0 /* unused code */
73 #if __ASSUME_NETLINK_SUPPORT == 0
74 extern int __no_netlink_support attribute_hidden;
76 # define __no_netlink_support 0
78 -#endif /* unused code */
81 extern int __netlink_open (struct netlink_handle *h) attribute_hidden;
82 extern void __netlink_close (struct netlink_handle *h) attribute_hidden;
83 Index: uclibc/include/ifaddrs.h
84 ===================================================================
86 +++ uclibc/include/ifaddrs.h
88 +/* ifaddrs.h -- declarations for getting network interface addresses
89 + Copyright (C) 2002 Free Software Foundation, Inc.
90 + This file is part of the GNU C Library.
92 + The GNU C Library is free software; you can redistribute it and/or
93 + modify it under the terms of the GNU Lesser General Public
94 + License as published by the Free Software Foundation; either
95 + version 2.1 of the License, or (at your option) any later version.
97 + The GNU C Library is distributed in the hope that it will be useful,
98 + but WITHOUT ANY WARRANTY; without even the implied warranty of
99 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
100 + Lesser General Public License for more details.
102 + You should have received a copy of the GNU Lesser General Public
103 + License along with the GNU C Library; if not, write to the Free
104 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
108 +#define _IFADDRS_H 1
110 +#include <features.h>
111 +#include <sys/socket.h>
115 +/* The `getifaddrs' function generates a linked list of these structures.
116 + Each element of the list describes one network interface. */
119 + struct ifaddrs *ifa_next; /* Pointer to the next structure. */
121 + char *ifa_name; /* Name of this network interface. */
122 + unsigned int ifa_flags; /* Flags as from SIOCGIFFLAGS ioctl. */
124 + struct sockaddr *ifa_addr; /* Network address of this interface. */
125 + struct sockaddr *ifa_netmask; /* Netmask of this interface. */
128 + /* At most one of the following two is valid. If the IFF_BROADCAST
129 + bit is set in `ifa_flags', then `ifa_broadaddr' is valid. If the
130 + IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
131 + It is never the case that both these bits are set at once. */
132 + struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
133 + struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
135 + /* These very same macros are defined by <net/if.h> for `struct ifaddr'.
136 + So if they are defined already, the existing definitions will be fine. */
137 +# ifndef ifa_broadaddr
138 +# define ifa_broadaddr ifa_ifu.ifu_broadaddr
140 +# ifndef ifa_dstaddr
141 +# define ifa_dstaddr ifa_ifu.ifu_dstaddr
144 + void *ifa_data; /* Address-specific data (may be unused). */
148 +/* Create a linked list of `struct ifaddrs' structures, one for each
149 + network interface on the host machine. If successful, store the
150 + list in *IFAP and return 0. On errors, return -1 and set `errno'.
152 + The storage returned in *IFAP is allocated dynamically and can
153 + only be properly freed by passing it to `freeifaddrs'. */
154 +extern int getifaddrs (struct ifaddrs **__ifap) __THROW;
156 +/* Reclaim the storage allocated by a previous `getifaddrs' call. */
157 +extern void freeifaddrs (struct ifaddrs *__ifa) __THROW;
161 +#endif /* ifaddrs.h */