[rtems commit] network: Remove FreeBSD specific hack

Sebastian Huber sebh at rtems.org
Mon Jun 12 12:04:13 UTC 2017


Module:    rtems
Branch:    master
Commit:    86c100439c5f33f5def3edf2ee05ea591b1774a4
Changeset: http://git.rtems.org/rtems/commit/?id=86c100439c5f33f5def3edf2ee05ea591b1774a4

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jun 12 13:56:40 2017 +0200

network: Remove FreeBSD specific hack

For whatever reason FreeBSD renames several functions provided by
<arpa/inet.h> and uses weak references to provide the standard function
names.  This causes problems on targets lacking proper support for weak
references.  We do not need this function renaming on RTEMS.lk:x

Update #2833.

---

 cpukit/libnetworking/include/arpa/inet.h | 21 ---------------------
 cpukit/libnetworking/libc/inet_addr.c    |  2 ++
 cpukit/libnetworking/libc/inet_ntoa.c    |  2 ++
 cpukit/libnetworking/libc/inet_ntop.c    |  2 ++
 cpukit/libnetworking/libc/res_stubs.c    |  2 ++
 5 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/cpukit/libnetworking/include/arpa/inet.h b/cpukit/libnetworking/include/arpa/inet.h
index d71c927..91e3a82 100644
--- a/cpukit/libnetworking/include/arpa/inet.h
+++ b/cpukit/libnetworking/include/arpa/inet.h
@@ -112,27 +112,6 @@ struct in_addr {
 #define	_STRUCT_IN_ADDR_DECLARED
 #endif
 
-/* XXX all new diversions!! argh!! */
-#if __BSD_VISIBLE
-#define	inet_addr		__inet_addr
-#define	inet_aton		__inet_aton
-#define	inet_lnaof		__inet_lnaof
-#define	inet_makeaddr		__inet_makeaddr
-#define	inet_neta		__inet_neta
-#define	inet_netof		__inet_netof
-#define	inet_network		__inet_network
-#define	inet_net_ntop		__inet_net_ntop
-#define	inet_net_pton		__inet_net_pton
-#define	inet_cidr_ntop		__inet_cidr_ntop
-#define	inet_cidr_pton		__inet_cidr_pton
-#define	inet_ntoa		__inet_ntoa
-#define	inet_ntoa_r		__inet_ntoa_r
-#define	inet_pton		__inet_pton
-#define	inet_ntop		__inet_ntop
-#define	inet_nsap_addr		__inet_nsap_addr
-#define	inet_nsap_ntoa		__inet_nsap_ntoa
-#endif /* __BSD_VISIBLE */
-
 __BEGIN_DECLS
 #ifndef _BYTEORDER_PROTOTYPED
 #define	_BYTEORDER_PROTOTYPED
diff --git a/cpukit/libnetworking/libc/inet_addr.c b/cpukit/libnetworking/libc/inet_addr.c
index 2e1dc35..af72d50 100644
--- a/cpukit/libnetworking/libc/inet_addr.c
+++ b/cpukit/libnetworking/libc/inet_addr.c
@@ -202,6 +202,7 @@ inet_aton(const char *cp, struct in_addr *addr) {
 	return (1);
 }
 
+#ifndef __rtems__
 /*
  * Weak aliases for applications that use certain private entry points,
  * and fail to include <arpa/inet.h>.
@@ -210,5 +211,6 @@ inet_aton(const char *cp, struct in_addr *addr) {
 __weak_reference(__inet_addr, inet_addr);
 #undef inet_aton
 __weak_reference(__inet_aton, inet_aton);
+#endif /* __rtems__ */
 
 /*! \file */
diff --git a/cpukit/libnetworking/libc/inet_ntoa.c b/cpukit/libnetworking/libc/inet_ntoa.c
index 0fecfe3..80f662d 100644
--- a/cpukit/libnetworking/libc/inet_ntoa.c
+++ b/cpukit/libnetworking/libc/inet_ntoa.c
@@ -67,6 +67,7 @@ inet_ntoa_r(struct in_addr in, char *buf, socklen_t size)
 	return (buf);
 }
 
+#ifndef __rtems__
 /*
  * Weak aliases for applications that use certain private entry points,
  * and fail to include <arpa/inet.h>.
@@ -74,5 +75,6 @@ inet_ntoa_r(struct in_addr in, char *buf, socklen_t size)
 #undef inet_ntoa
 __weak_reference(__inet_ntoa, inet_ntoa);
 __weak_reference(__inet_ntoa_r, inet_ntoa_r);
+#endif /* __rtems__ */
 
 /*! \file */
diff --git a/cpukit/libnetworking/libc/inet_ntop.c b/cpukit/libnetworking/libc/inet_ntop.c
index b54eec7..4ea2ee3 100644
--- a/cpukit/libnetworking/libc/inet_ntop.c
+++ b/cpukit/libnetworking/libc/inet_ntop.c
@@ -194,11 +194,13 @@ inet_ntop6(const u_char *src, char *dst, socklen_t size)
 	return (dst);
 }
 
+#ifndef __rtems__
 /*
  * Weak aliases for applications that use certain private entry points,
  * and fail to include <arpa/inet.h>.
  */
 #undef inet_ntop
 __weak_reference(__inet_ntop, inet_ntop);
+#endif /* __rtems__ */
 
 /*! \file */
diff --git a/cpukit/libnetworking/libc/res_stubs.c b/cpukit/libnetworking/libc/res_stubs.c
index eb32ccb..3e8b4ee 100644
--- a/cpukit/libnetworking/libc/res_stubs.c
+++ b/cpukit/libnetworking/libc/res_stubs.c
@@ -43,6 +43,7 @@
 #include <sys/types.h>
 #include <sys/cdefs.h>
 
+#ifndef __rtems__
 __weak_reference(__inet_addr, inet_addr);
 __weak_reference(__inet_aton, inet_aton);
 __weak_reference(__inet_lnaof, inet_lnaof);
@@ -57,6 +58,7 @@ __weak_reference(__inet_pton, inet_pton);
 __weak_reference(__inet_ntop, inet_ntop);
 __weak_reference(__inet_nsap_addr, inet_nsap_addr);
 __weak_reference(__inet_nsap_ntoa, inet_nsap_ntoa);
+#endif /* __rtems__ */
 
 __weak_reference(__sym_ston, sym_ston);
 __weak_reference(__sym_ntos, sym_ntos);



More information about the vc mailing list