summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch')
-rw-r--r--meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch b/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch
new file mode 100644
index 000000000..6e2f4109c
--- /dev/null
+++ b/meta-agl-profile-telematics/recipes-core/systemd/files/0002-networkd-link-link_up_can-move-function-upwards.patch
@@ -0,0 +1,82 @@
+From 833fbbe448fca5f7047708db2d0d91778aabbb93 Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Wed, 30 May 2018 16:31:59 +0200
+Subject: [PATCH 2/3] networkd-link: link_up_can(): move function upwards
+
+This patch is a preparation patch, to avoid forward declarations in the
+next patch.
+---
+ src/network/networkd-link.c | 50 ++++++++++++++++++-------------------
+ 1 file changed, 25 insertions(+), 25 deletions(-)
+
+diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
+index c29ae30ef0..a736dc1a74 100644
+--- a/src/network/networkd-link.c
++++ b/src/network/networkd-link.c
+@@ -1780,6 +1780,31 @@ int link_up(Link *link) {
+ return 0;
+ }
+
++static int link_up_can(Link *link) {
++ _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
++ int r;
++
++ assert(link);
++
++ log_link_debug(link, "Bringing CAN link up");
++
++ r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
++ if (r < 0)
++ return log_link_error_errno(link, r, "Could not allocate RTM_SETLINK message: %m");
++
++ r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
++ if (r < 0)
++ return log_link_error_errno(link, r, "Could not set link flags: %m");
++
++ r = sd_netlink_call_async(link->manager->rtnl, req, link_up_handler, link, 0, NULL);
++ if (r < 0)
++ return log_link_error_errno(link, r, "Could not send rtnetlink message: %m");
++
++ link_ref(link);
++
++ return 0;
++}
++
+ static int link_down_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
+ _cleanup_link_unref_ Link *link = userdata;
+ int r;
+@@ -1824,31 +1849,6 @@ int link_down(Link *link) {
+ return 0;
+ }
+
+-static int link_up_can(Link *link) {
+- _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
+- int r;
+-
+- assert(link);
+-
+- log_link_debug(link, "Bringing CAN link up");
+-
+- r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
+- if (r < 0)
+- return log_link_error_errno(link, r, "Could not allocate RTM_SETLINK message: %m");
+-
+- r = sd_rtnl_message_link_set_flags(req, IFF_UP, IFF_UP);
+- if (r < 0)
+- return log_link_error_errno(link, r, "Could not set link flags: %m");
+-
+- r = sd_netlink_call_async(link->manager->rtnl, req, link_up_handler, link, 0, NULL);
+- if (r < 0)
+- return log_link_error_errno(link, r, "Could not send rtnetlink message: %m");
+-
+- link_ref(link);
+-
+- return 0;
+-}
+-
+ static int link_handle_bound_to_list(Link *link) {
+ Link *l;
+ Iterator i;
+--
+2.17.1
+