From 5cf79759a24e9bb2a6a3aef7c83d73efb9bf2df3 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Fri, 29 Jun 2018 23:15:28 +0200 Subject: 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 Signed-off-by: Alexander Couzens --- iprule.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'iprule.h') 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]; -- cgit v1.2.3