summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-05-07 19:12:55 +0200
committerGitHub <noreply@github.com>2020-05-07 19:12:55 +0200
commitfaad472899e0be77160c134914b34d06365be949 (patch)
tree857930f7ec48f2bf5e0debe744357ff037937459
parentMerge pull request #6356 from ton31337/fix/aggregator_0_ignore (diff)
parentzebra: Add code to install v6 blackhole routes on *bsd (diff)
downloadfrr-faad472899e0be77160c134914b34d06365be949.tar.xz
frr-faad472899e0be77160c134914b34d06365be949.zip
Merge pull request #6365 from donaldsharp/bsd_v6_Null_bsbase_7.4
zebra: Add code to install v6 blackhole routes on *bsd
-rw-r--r--zebra/rt_socket.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index 6909bcb13..64fd7fa49 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -180,6 +180,7 @@ static int kernel_rtm(int cmd, const struct prefix *p,
switch (p->family) {
case AF_INET: {
struct in_addr loopback;
+
loopback.s_addr = htonl(INADDR_LOOPBACK);
sin_gate.sin.sin_addr = loopback;
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
@@ -187,11 +188,21 @@ static int kernel_rtm(int cmd, const struct prefix *p,
sizeof(struct sockaddr_in);
#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
gate = true;
- }
- break;
- case AF_INET6:
- zlog_warn("v6 blackhole routes have not been programmed yet");
- break;
+ } break;
+ case AF_INET6: {
+ struct in6_addr loopback;
+
+ inet_pton(AF_INET6, "::1", &loopback);
+
+ sin_gate.sin6.sin6_addr = loopback;
+ sin_gate.sin6.sin6_family = AF_INET6;
+
+#ifdef HAVE_STRUCTSOCKADDR_SA_LEN
+ sin_gate.sin6.sin6_len =
+ sizeof(struct sockaddr_in6);
+#endif /* HAVE_STRUCTSOCKADDR_SA_LEN */
+ gate = true;
+ } break;
}
}