wireless: fix use-after-free bug
[project/netifd.git] / system.h
index 1b16bb9..ad74156 100644 (file)
--- a/system.h
+++ b/system.h
@@ -28,17 +28,17 @@ enum tunnel_param {
        TUNNEL_ATTR_TTL,
        TUNNEL_ATTR_6RD_PREFIX,
        TUNNEL_ATTR_6RD_RELAY_PREFIX,
        TUNNEL_ATTR_TTL,
        TUNNEL_ATTR_6RD_PREFIX,
        TUNNEL_ATTR_6RD_RELAY_PREFIX,
+       TUNNEL_ATTR_LINK,
        __TUNNEL_ATTR_MAX
 };
 
        __TUNNEL_ATTR_MAX
 };
 
-const struct config_param_list tunnel_attr_list;
+const struct uci_blob_param_list tunnel_attr_list;
 
 enum bridge_opt {
        /* stp and forward delay always set */
        BRIDGE_OPT_AGEING_TIME = (1 << 0),
        BRIDGE_OPT_HELLO_TIME  = (1 << 1),
        BRIDGE_OPT_MAX_AGE     = (1 << 2),
 
 enum bridge_opt {
        /* stp and forward delay always set */
        BRIDGE_OPT_AGEING_TIME = (1 << 0),
        BRIDGE_OPT_HELLO_TIME  = (1 << 1),
        BRIDGE_OPT_MAX_AGE     = (1 << 2),
-       BRIDGE_OPT_PRIORITY    = (1 << 3),
 };
 
 struct bridge_config {
 };
 
 struct bridge_config {
@@ -47,12 +47,24 @@ struct bridge_config {
        bool igmp_snoop;
        unsigned short priority;
        int forward_delay;
        bool igmp_snoop;
        unsigned short priority;
        int forward_delay;
+       bool bridge_empty;
 
        int ageing_time;
        int hello_time;
        int max_age;
 };
 
 
        int ageing_time;
        int hello_time;
        int max_age;
 };
 
+enum macvlan_opt {
+       MACVLAN_OPT_MACADDR = (1 << 0),
+};
+
+struct macvlan_config {
+       const char *mode;
+
+       enum macvlan_opt flags;
+       unsigned char macaddr[6];
+};
+
 static inline int system_get_addr_family(unsigned int flags)
 {
        if ((flags & DEVADDR_FAMILY) == DEVADDR_INET6)
 static inline int system_get_addr_family(unsigned int flags)
 {
        if ((flags & DEVADDR_FAMILY) == DEVADDR_INET6)
@@ -76,6 +88,9 @@ int system_bridge_delbr(struct device *bridge);
 int system_bridge_addif(struct device *bridge, struct device *dev);
 int system_bridge_delif(struct device *bridge, struct device *dev);
 
 int system_bridge_addif(struct device *bridge, struct device *dev);
 int system_bridge_delif(struct device *bridge, struct device *dev);
 
+int system_macvlan_add(struct device *macvlan, struct device *dev, struct macvlan_config *cfg);
+int system_macvlan_del(struct device *macvlan);
+
 int system_vlan_add(struct device *dev, int id);
 int system_vlan_del(struct device *dev);
 
 int system_vlan_add(struct device *dev, int id);
 int system_vlan_del(struct device *dev);