Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/dhcpcd/dist/src As dhcpcd no longer supports IP...



details:   https://anonhg.NetBSD.org/src/rev/f42646da11ba
branches:  trunk
changeset: 462173:f42646da11ba
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Jul 26 10:53:45 2019 +0000

description:
As dhcpcd no longer supports IPv4 address advertisement for SMALL builds,
remove the equivalent IPv6 functionality.
This shouldn't be an issue as this is only used for IPv6 address sharing,
which only the NetBSD kernel currently supports.

diffstat:

 external/bsd/dhcpcd/dist/src/dhcp6.c  |   6 ++++++
 external/bsd/dhcpcd/dist/src/ipv6.c   |  12 +++++++++++-
 external/bsd/dhcpcd/dist/src/ipv6.h   |   4 ++++
 external/bsd/dhcpcd/dist/src/ipv6nd.c |   4 ++++
 4 files changed, 25 insertions(+), 1 deletions(-)

diffs (137 lines):

diff -r 8333d1c8e1e5 -r f42646da11ba external/bsd/dhcpcd/dist/src/dhcp6.c
--- a/external/bsd/dhcpcd/dist/src/dhcp6.c      Fri Jul 26 10:53:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.c      Fri Jul 26 10:53:45 2019 +0000
@@ -1523,7 +1523,9 @@
                                if (valid)
                                        dhcpcd_daemonise(ifp->ctx);
                        }
+#ifdef ND6_ADVERTISE
                        ipv6nd_advertise(ia);
+#endif
                }
        }
 }
@@ -3927,16 +3929,20 @@
 void
 dhcp6_abort(struct interface *ifp)
 {
+#ifdef ND6_ADVERTISE
        struct dhcp6_state *state;
        struct ipv6_addr *ia;
+#endif
 
        eloop_timeout_delete(ifp->ctx->eloop, dhcp6_start1, ifp);
+#ifdef ND6_ADVERTISE
        state = D6_STATE(ifp);
        if (state == NULL)
                return;
        TAILQ_FOREACH(ia, &state->addrs, next) {
                ipv6nd_advertise(ia);
        }
+#endif
 }
 
 void
diff -r 8333d1c8e1e5 -r f42646da11ba external/bsd/dhcpcd/dist/src/ipv6.c
--- a/external/bsd/dhcpcd/dist/src/ipv6.c       Fri Jul 26 10:53:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv6.c       Fri Jul 26 10:53:45 2019 +0000
@@ -616,8 +616,10 @@
                }
        }
 
+#ifdef ND6_ADVERTISE
        /* Advertise the address if it exists on another interface. */
        ipv6nd_advertise(ia);
+#endif
 }
 
 static int
@@ -625,8 +627,10 @@
 {
        struct interface *ifp;
        uint32_t pltime, vltime;
+       __printflike(1, 2) void (*logfunc)(const char *, ...);
+#ifdef ND6_ADVERTISE
        bool vltime_was_zero;
-       __printflike(1, 2) void (*logfunc)(const char *, ...);
+#endif
 #ifdef __sun
        struct ipv6_state *state;
        struct ipv6_addr *ia2;
@@ -694,7 +698,9 @@
                    " seconds",
                    ifp->name, ia->prefix_pltime, ia->prefix_vltime);
 
+#ifdef ND6_ADVERTISE
        vltime_was_zero = ia->prefix_vltime == 0;
+#endif
        if (if_address6(RTM_NEWADDR, ia) == -1) {
                logerr(__func__);
                /* Restore real pltime and vltime */
@@ -758,9 +764,11 @@
        }
 #endif
 
+#ifdef ND6_ADVERTISE
        /* Re-advertise the preferred address to be safe. */
        if (!vltime_was_zero)
                ipv6nd_advertise(ia);
+#endif
 
        return 0;
 }
@@ -1081,9 +1089,11 @@
        case RTM_DELADDR:
                if (ia != NULL) {
                        TAILQ_REMOVE(&state->addrs, ia, next);
+#ifdef ND6_ADVERTISE
                        /* Advertise the address if it exists on
                         * another interface. */
                        ipv6nd_advertise(ia);
+#endif
                        /* We'll free it at the end of the function. */
                }
                break;
diff -r 8333d1c8e1e5 -r f42646da11ba external/bsd/dhcpcd/dist/src/ipv6.h
--- a/external/bsd/dhcpcd/dist/src/ipv6.h       Fri Jul 26 10:53:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv6.h       Fri Jul 26 10:53:45 2019 +0000
@@ -149,6 +149,10 @@
 #  define IN6_IFF_DETACHED     0
 #endif
 
+#ifndef SMALL
+#  define ND6_ADVERTISE
+#endif
+
 #ifdef INET6
 TAILQ_HEAD(ipv6_addrhead, ipv6_addr);
 struct ipv6_addr {
diff -r 8333d1c8e1e5 -r f42646da11ba external/bsd/dhcpcd/dist/src/ipv6nd.c
--- a/external/bsd/dhcpcd/dist/src/ipv6nd.c     Fri Jul 26 10:53:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv6nd.c     Fri Jul 26 10:53:45 2019 +0000
@@ -389,6 +389,7 @@
        }
 }
 
+#ifdef ND6_ADVERTISE
 static void
 ipv6nd_sendadvertisement(void *arg)
 {
@@ -526,6 +527,7 @@
        eloop_timeout_delete(ctx->eloop, ipv6nd_sendadvertisement, iaf);
        ipv6nd_sendadvertisement(iaf);
 }
+#endif /* ND6_ADVERTISE */
 
 static void
 ipv6nd_expire(void *arg)
@@ -908,7 +910,9 @@
                                        return;
                        }
                }
+#ifdef ND6_ADVERTISE
                ipv6nd_advertise(ia);
+#endif
        }
 }
 



Home | Main Index | Thread Index | Old Index