summaryrefslogtreecommitdiffhomepage
path: root/iprule.h
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2018-06-29 23:15:28 +0200
committerAlexander Couzens <lynxis@fe80.eu>2018-07-05 02:45:37 +0200
commit5cf79759a24e9bb2a6a3aef7c83d73efb9bf2df3 (patch)
treef9bdb72949126a14687f6205e24d5cd29cbe638a /iprule.h
parent57f87ad89b38d1ea574c39a2d720747120dcc5fb (diff)
iprule: rework interface based rules to handle dynamic interfaces
Previous netifd would only apply `ip rule`s while config phase. If the iprule is depending on an interface (iif or oif), the rule will fail if the interface is not up. Allow iprules to track interfaces and their devices by using the interface events. Fixes: FS#1571 Acked-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Diffstat (limited to 'iprule.h')
-rw-r--r--iprule.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/iprule.h b/iprule.h
index b723bdb..f05c3c9 100644
--- a/iprule.h
+++ b/iprule.h
@@ -74,6 +74,15 @@ struct iprule {
bool invert;
+ /* uci interface name */
+ char *in_iface;
+ char *out_iface;
+
+ /* to receive interface events */
+ struct interface_user in_iface_user;
+ struct interface_user out_iface_user;
+
+ /* device name */
char in_dev[IFNAMSIZ + 1];
char out_dev[IFNAMSIZ + 1];