All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH v3 2/5] netconfig: Request all known IPv6 addresses
Date: Tue, 01 Oct 2019 09:31:21 -0700	[thread overview]
Message-ID: <20191001163124.1179-2-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20191001163124.1179-1-tim.a.kourt@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

---
 src/netconfig.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/netconfig.c b/src/netconfig.c
index c9b0b66e..be710ebb 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -418,6 +418,22 @@ static void netconfig_ifaddr_ipv6_notify(uint16_t type, const void *data,
 	}
 }
 
+static void netconfig_ifaddr_ipv6_cmd_cb(int error, uint16_t type,
+						const void *data, uint32_t len,
+						void *user_data)
+{
+	if (error) {
+		l_error("netconfig: ifaddr IPv6 command failure. "
+				"Error %d: %s", error, strerror(-error));
+		return;
+	}
+
+	if (type != RTM_NEWADDR)
+		return;
+
+	netconfig_ifaddr_ipv6_notify(type, data, len, user_data);
+}
+
 static void netconfig_route_cmd_cb(int error, uint16_t type,
 						const void *data, uint32_t len,
 						void *user_data)
@@ -848,6 +864,14 @@ static int netconfig_init(void)
 		goto error;
 	}
 
+	r = rtnl_ifaddr_ipv6_get(rtnl, netconfig_ifaddr_ipv6_cmd_cb, NULL,
+									NULL);
+	if (!r) {
+		l_error("netconfig: Failed to get IPv6 addresses from RTNL"
+								" link.");
+		goto error;
+	}
+
 	if (!l_settings_get_uint(iwd_get_config(), "General",
 							"route_priority_offset",
 							&ROUTE_PRIORITY_OFFSET))
-- 
2.13.6

  reply	other threads:[~2019-10-01 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 16:31 [PATCH v3 1/5] netconfig: Subscribe for IPv6 address changes Tim Kourt
2019-10-01 16:31 ` Tim Kourt [this message]
2019-10-01 16:31 ` [PATCH v3 3/5] netconfig: Add IPv6 static address installation/removal Tim Kourt
2019-10-01 16:31 ` [PATCH v3 4/5] netconfig: Install IPv6 default route Tim Kourt
2019-10-01 16:31 ` [PATCH v3 5/5] netconfig: Install IPv6 DNS Tim Kourt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191001163124.1179-2-tim.a.kourt@linux.intel.com \
    --to=tim.a.kourt@linux.intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.