Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
darkbit
ffbs-gluon
Commits
d967d58a
Unverified
Commit
d967d58a
authored
7 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
netifd: ubus: add interface method to trigger renew event
parent
872784cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patches/lede/0012-netifd-ubus-add-interface-method-to-trigger-renew-event.patch
+83
-0
83 additions, 0 deletions
...fd-ubus-add-interface-method-to-trigger-renew-event.patch
with
83 additions
and
0 deletions
patches/lede/0012-netifd-ubus-add-interface-method-to-trigger-renew-event.patch
0 → 100644
+
83
−
0
View file @
d967d58a
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 12 Apr 2017 02:31:12 +0200
Subject: netifd: ubus: add interface method to trigger renew event
diff --git a/package/network/config/netifd/patches/0001-ubus-add-interface-method-to-trigger-renew-event.patch b/package/network/config/netifd/patches/0001-ubus-add-interface-method-to-trigger-renew-event.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1f59498d421b7e1d3e76a1a38f604181d11c4649
--- /dev/null
+++ b/package/network/config/netifd/patches/0001-ubus-add-interface-method-to-trigger-renew-event.patch
@@ -0,0 +1,73 @@
+From 8b39c2fce4c1da3f3dcd4c6fd305c124714839e8 Mon Sep 17 00:00:00 2001
+Message-Id: <8b39c2fce4c1da3f3dcd4c6fd305c124714839e8.1491956920.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Wed, 12 Apr 2017 02:25:33 +0200
+Subject: [PATCH] ubus: add interface method to trigger renew event
+
+proto-shell handlers may implement all kinds of renew handlers, there
+should be a way to explicitly trigger such a renew.
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+---
+ interface.c | 8 ++++++++
+ interface.h | 1 +
+ ubus.c | 14 ++++++++++++++
+ 3 files changed, 23 insertions(+)
+
+--- a/interface.c
++++ b/interface.c
+@@ -1076,6 +1076,14 @@ interface_set_down(struct interface *ifa
+ return 0;
+ }
+
++int interface_renew(struct interface *iface)
++{
++ if (iface->state == IFS_TEARDOWN || iface->state == IFS_DOWN)
++ return -1;
++
++ return interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
++}
++
+ void
+ interface_start_pending(void)
+ {
+--- a/interface.h
++++ b/interface.h
+@@ -184,6 +184,7 @@ void interface_set_available(struct inte
+ int interface_set_up(struct interface *iface);
+ int interface_set_down(struct interface *iface);
+ void __interface_set_down(struct interface *iface, bool force);
++int interface_renew(struct interface *iface);
+
+ void interface_set_main_dev(struct interface *iface, struct device *dev);
+ void interface_set_l3_dev(struct interface *iface, struct device *dev);
+--- a/ubus.c
++++ b/ubus.c
+@@ -376,6 +376,19 @@ netifd_handle_down(struct ubus_context *
+ return 0;
+ }
+
++static int
++netifd_handle_renew(struct ubus_context *ctx, struct ubus_object *obj,
++ struct ubus_request_data *req, const char *method,
++ struct blob_attr *msg)
++{
++ struct interface *iface;
++
++ iface = container_of(obj, struct interface, ubus);
++ interface_renew(iface);
++
++ return 0;
++}
++
+ static void
+ netifd_add_interface_errors(struct blob_buf *b, struct interface *iface)
+ {
+@@ -912,6 +925,7 @@ netifd_handle_set_data(struct ubus_conte
+ static struct ubus_method iface_object_methods[] = {
+ { .name = "up", .handler = netifd_handle_up },
+ { .name = "down", .handler = netifd_handle_down },
++ { .name = "renew", .handler = netifd_handle_renew },
+ { .name = "status", .handler = netifd_handle_status },
+ { .name = "prepare", .handler = netifd_handle_iface_prepare },
+ { .name = "dump", .handler = netifd_handle_dump },
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment