[rtems-libbsd commit] freebsd: Add constant ipv6 addresses from vars.c.

Sebastian Huber sebh at rtems.org
Thu Aug 4 13:45:30 UTC 2016


Module:    rtems-libbsd
Branch:    master
Commit:    2fb3a360e7907c9192e46cc59ebd7048995363bc
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=2fb3a360e7907c9192e46cc59ebd7048995363bc

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Thu Aug  4 14:12:17 2016 +0200

freebsd: Add constant ipv6 addresses from vars.c.

This is necessary for a configuration without IPv6.

---

 create-kernel-namespace.sh                            | 3 +++
 freebsd/lib/libc/net/vars.c                           | 2 ++
 freebsd/sys/netinet6/in6.c                            | 2 ++
 libbsd.py                                             | 1 +
 libbsd_waf.py                                         | 1 +
 rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h | 3 ---
 6 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/create-kernel-namespace.sh b/create-kernel-namespace.sh
index 0524c74..1b3391c 100755
--- a/create-kernel-namespace.sh
+++ b/create-kernel-namespace.sh
@@ -60,6 +60,9 @@ objdump --syms `for i in build/*rtems* ; do \
 	| sed '/^getsockopt$/d' \
 	| sed '/^ifqmaxlen$/d' \
 	| sed '/^in6addr_any$/d' \
+	| sed '/^in6addr_loopback$/d' \
+	| sed '/^in6addr_nodelocal_allnodes$/d' \
+	| sed '/^in6addr_linklocal_allnodes$/d' \
 	| sed '/^kevent$/d' \
 	| sed '/^kqueue$/d' \
 	| sed '/^listen$/d' \
diff --git a/freebsd/lib/libc/net/vars.c b/freebsd/lib/libc/net/vars.c
index 42ee205..b3355ff 100644
--- a/freebsd/lib/libc/net/vars.c
+++ b/freebsd/lib/libc/net/vars.c
@@ -1,3 +1,5 @@
+#include <machine/rtems-bsd-user-space.h>
+
 /*	$KAME: vars.c,v 1.2 2001/08/20 02:32:41 itojun Exp $	*/
 
 /*
diff --git a/freebsd/sys/netinet6/in6.c b/freebsd/sys/netinet6/in6.c
index 8487a8c..66888fa 100644
--- a/freebsd/sys/netinet6/in6.c
+++ b/freebsd/sys/netinet6/in6.c
@@ -113,12 +113,14 @@ VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix);
 /*
  * Definitions of some costant IP6 addresses.
  */
+#ifndef __rtems__
 const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
 const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
 const struct in6_addr in6addr_nodelocal_allnodes =
 	IN6ADDR_NODELOCAL_ALLNODES_INIT;
 const struct in6_addr in6addr_linklocal_allnodes =
 	IN6ADDR_LINKLOCAL_ALLNODES_INIT;
+#endif /* __rtems__ */
 const struct in6_addr in6addr_linklocal_allrouters =
 	IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
 const struct in6_addr in6addr_linklocal_allv2routers =
diff --git a/libbsd.py b/libbsd.py
index 5a88d87..d466ac6 100755
--- a/libbsd.py
+++ b/libbsd.py
@@ -1986,6 +1986,7 @@ def user_space(mm):
             'lib/libc/net/recv.c',
             'lib/libc/net/rthdr.c',
             'lib/libc/net/send.c',
+            'lib/libc/net/vars.c',
             'lib/libc/posix1e/mac.c',
             'lib/libc/resolv/h_errno.c',
             'lib/libc/resolv/herror.c',
diff --git a/libbsd_waf.py b/libbsd_waf.py
index 4b68863..5ae6ae1 100644
--- a/libbsd_waf.py
+++ b/libbsd_waf.py
@@ -295,6 +295,7 @@ def build(bld):
                      'freebsd/lib/libc/net/recv.c',
                      'freebsd/lib/libc/net/rthdr.c',
                      'freebsd/lib/libc/net/send.c',
+                     'freebsd/lib/libc/net/vars.c',
                      'freebsd/lib/libc/posix1e/mac.c',
                      'freebsd/lib/libc/resolv/h_errno.c',
                      'freebsd/lib/libc/resolv/herror.c',
diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
index 3ad19e3..059ca1c 100644
--- a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
+++ b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
@@ -1326,11 +1326,8 @@
 #define	im6o_mc_filter _bsd_im6o_mc_filter
 #define	imo_multi_filter _bsd_imo_multi_filter
 #define	in4_cksum _bsd_in4_cksum
-#define	in6addr_linklocal_allnodes _bsd_in6addr_linklocal_allnodes
 #define	in6addr_linklocal_allrouters _bsd_in6addr_linklocal_allrouters
 #define	in6addr_linklocal_allv2routers _bsd_in6addr_linklocal_allv2routers
-#define	in6addr_loopback _bsd_in6addr_loopback
-#define	in6addr_nodelocal_allnodes _bsd_in6addr_nodelocal_allnodes
 #define	in6_addrscope _bsd_in6_addrscope
 #define	in6_are_prefix_equal _bsd_in6_are_prefix_equal
 #define	in6_cksum _bsd_in6_cksum



More information about the vc mailing list