aboutgitcodebugslistschat
path: root/ndp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ndp.c')
-rw-r--r--ndp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ndp.c b/ndp.c
index eb090cd..588b48f 100644
--- a/ndp.c
+++ b/ndp.c
@@ -438,3 +438,23 @@ void ndp_timer(const struct ctx *c, const struct timespec *now)
first:
next_ra = now->tv_sec + interval;
}
+
+/**
+ * ndp_send_init_req() - Send initial NDP NS to retrieve guest MAC address
+ * @c: Execution context
+ */
+void ndp_send_init_req(const struct ctx *c)
+{
+ struct ndp_ns ns = {
+ .ih = {
+ .icmp6_type = NS,
+ .icmp6_code = 0,
+ .icmp6_router = 0, /* Reserved */
+ .icmp6_solicited = 0, /* Reserved */
+ .icmp6_override = 0, /* Reserved */
+ },
+ .target_addr = c->ip6.addr
+ };
+ debug("Sending initial NDP NS request for guest MAC address");
+ ndp_send(c, &c->ip6.addr, &ns, sizeof(ns));
+}