Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Fix ifdef; care about a case w/ INET6 and w/o INET



details:   https://anonhg.NetBSD.org/src/rev/b99a39dc2f76
branches:  trunk
changeset: 825008:b99a39dc2f76
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jun 26 06:58:42 2017 +0000

description:
Fix ifdef; care about a case w/ INET6 and w/o INET

diffstat:

 sys/net/rtsock.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (76 lines):

diff -r f96630551783 -r b99a39dc2f76 sys/net/rtsock.c
--- a/sys/net/rtsock.c  Mon Jun 26 05:34:48 2017 +0000
+++ b/sys/net/rtsock.c  Mon Jun 26 06:58:42 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock.c,v 1.221 2017/06/26 03:16:28 ozaki-r Exp $     */
+/*     $NetBSD: rtsock.c,v 1.222 2017/06/26 06:58:42 ozaki-r Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.221 2017/06/26 03:16:28 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.222 2017/06/26 06:58:42 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -474,7 +474,7 @@
        return EOPNOTSUPP;
 }
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
 static int
 route_get_sdl_index(struct rt_addrinfo *info, int *sdl_index)
 {
@@ -493,7 +493,7 @@
 
        return 0;
 }
-#endif /* INET */
+#endif
 
 static void
 route_get_sdl(const struct ifnet *ifp, const struct sockaddr *dst,
@@ -799,8 +799,8 @@
                if (info.rti_info[RTAX_GATEWAY] == NULL) {
                        senderr(EINVAL);
                }
-#ifdef INET
-               /* support for new ARP code with keeping backcompat */
+#if defined(INET) || defined(INET6)
+               /* support for new ARP/NDP code with keeping backcompat */
                if (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) {
                        const struct sockaddr_dl *sdlp =
                            satocsdl(info.rti_info[RTAX_GATEWAY]);
@@ -842,7 +842,7 @@
                        break;
                }
        fallback:
-#endif /* INET */
+#endif /* defined(INET) || defined(INET6) */
                error = rtrequest1(rtm->rtm_type, &info, &saved_nrt);
                if (error == 0) {
                        rt_setmetrics(rtm->rtm_inits, rtm, saved_nrt);
@@ -851,8 +851,8 @@
                break;
 
        case RTM_DELETE:
-#ifdef INET
-               /* support for new ARP code */
+#if defined(INET) || defined(INET6)
+               /* support for new ARP/NDP code */
                if (info.rti_info[RTAX_GATEWAY] &&
                    (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) &&
                    (rtm->rtm_flags & RTF_LLDATA) != 0) {
@@ -862,7 +862,7 @@
                            rtm->rtm_rmx.rmx_expire, &info, sdlp->sdl_index);
                        break;
                }
-#endif /* INET */
+#endif
                error = rtrequest1(rtm->rtm_type, &info, &saved_nrt);
                if (error != 0)
                        break;



Home | Main Index | Thread Index | Old Index