48
48
#include "gateway_common.h"
49
49
#include "hard-interface.h"
50
50
#include "log.h"
51
+ #include "netlink.h"
51
52
#include "network-coding.h"
52
53
#include "soft-interface.h"
53
54
@@ -154,9 +155,14 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
154
155
{ \
155
156
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
156
157
struct batadv_priv *bat_priv = netdev_priv(net_dev); \
158
+ ssize_t length; \
159
+ \
160
+ length = __batadv_store_bool_attr(buff, count, _post_func, attr,\
161
+ &bat_priv->_name, net_dev); \
157
162
\
158
- return __batadv_store_bool_attr(buff, count, _post_func, attr, \
159
- &bat_priv->_name, net_dev); \
163
+ batadv_netlink_notify_mesh(bat_priv); \
164
+ \
165
+ return length; \
160
166
}
161
167
162
168
#define BATADV_ATTR_SIF_SHOW_BOOL (_name ) \
@@ -186,11 +192,16 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
186
192
{ \
187
193
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
188
194
struct batadv_priv *bat_priv = netdev_priv(net_dev); \
195
+ ssize_t length; \
189
196
\
190
- return __batadv_store_uint_attr(buff, count, _min, _max, \
191
- _post_func, attr, \
192
- &bat_priv->_var, net_dev, \
193
- NULL); \
197
+ length = __batadv_store_uint_attr(buff, count, _min, _max, \
198
+ _post_func, attr, \
199
+ &bat_priv->_var, net_dev, \
200
+ NULL); \
201
+ \
202
+ batadv_netlink_notify_mesh(bat_priv); \
203
+ \
204
+ return length; \
194
205
}
195
206
196
207
#define BATADV_ATTR_SIF_SHOW_UINT (_name , _var ) \
@@ -223,6 +234,11 @@ ssize_t batadv_store_vlan_##_name(struct kobject *kobj, \
223
234
attr, &vlan->_name, \
224
235
bat_priv->soft_iface); \
225
236
\
237
+ if (vlan->vid) \
238
+ batadv_netlink_notify_vlan(bat_priv, vlan); \
239
+ else \
240
+ batadv_netlink_notify_mesh(bat_priv); \
241
+ \
226
242
batadv_softif_vlan_put(vlan); \
227
243
return res; \
228
244
}
@@ -256,6 +272,7 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
256
272
{ \
257
273
struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
258
274
struct batadv_hard_iface *hard_iface; \
275
+ struct batadv_priv *bat_priv; \
259
276
ssize_t length; \
260
277
\
261
278
hard_iface = batadv_hardif_get_by_netdev(net_dev); \
@@ -268,6 +285,11 @@ ssize_t batadv_store_##_name(struct kobject *kobj, \
268
285
hard_iface->soft_iface, \
269
286
net_dev); \
270
287
\
288
+ if (hard_iface->soft_iface) { \
289
+ bat_priv = netdev_priv(hard_iface->soft_iface); \
290
+ batadv_netlink_notify_hardif(bat_priv, hard_iface); \
291
+ } \
292
+ \
271
293
batadv_hardif_put(hard_iface); \
272
294
return length; \
273
295
}
@@ -537,6 +559,9 @@ static ssize_t batadv_store_gw_mode(struct kobject *kobj,
537
559
batadv_gw_check_client_stop (bat_priv );
538
560
atomic_set (& bat_priv -> gw .mode , (unsigned int )gw_mode_tmp );
539
561
batadv_gw_tvlv_container_update (bat_priv );
562
+
563
+ batadv_netlink_notify_mesh (bat_priv );
564
+
540
565
return count ;
541
566
}
542
567
@@ -563,6 +588,7 @@ static ssize_t batadv_store_gw_sel_class(struct kobject *kobj,
563
588
size_t count )
564
589
{
565
590
struct batadv_priv * bat_priv = batadv_kobj_to_batpriv (kobj );
591
+ ssize_t length ;
566
592
567
593
/* setting the GW selection class is allowed only if the routing
568
594
* algorithm in use implements the GW API
@@ -578,10 +604,14 @@ static ssize_t batadv_store_gw_sel_class(struct kobject *kobj,
578
604
return bat_priv -> algo_ops -> gw .store_sel_class (bat_priv , buff ,
579
605
count );
580
606
581
- return __batadv_store_uint_attr (buff , count , 1 , BATADV_TQ_MAX_VALUE ,
582
- batadv_post_gw_reselect , attr ,
583
- & bat_priv -> gw .sel_class ,
584
- bat_priv -> soft_iface , NULL );
607
+ length = __batadv_store_uint_attr (buff , count , 1 , BATADV_TQ_MAX_VALUE ,
608
+ batadv_post_gw_reselect , attr ,
609
+ & bat_priv -> gw .sel_class ,
610
+ bat_priv -> soft_iface , NULL );
611
+
612
+ batadv_netlink_notify_mesh (bat_priv );
613
+
614
+ return length ;
585
615
}
586
616
587
617
static ssize_t batadv_show_gw_bwidth (struct kobject * kobj ,
@@ -601,12 +631,18 @@ static ssize_t batadv_store_gw_bwidth(struct kobject *kobj,
601
631
struct attribute * attr , char * buff ,
602
632
size_t count )
603
633
{
634
+ struct batadv_priv * bat_priv = batadv_kobj_to_batpriv (kobj );
604
635
struct net_device * net_dev = batadv_kobj_to_netdev (kobj );
636
+ ssize_t length ;
605
637
606
638
if (buff [count - 1 ] == '\n' )
607
639
buff [count - 1 ] = '\0' ;
608
640
609
- return batadv_gw_bandwidth_set (net_dev , buff , count );
641
+ length = batadv_gw_bandwidth_set (net_dev , buff , count );
642
+
643
+ batadv_netlink_notify_mesh (bat_priv );
644
+
645
+ return length ;
610
646
}
611
647
612
648
/**
@@ -674,6 +710,8 @@ static ssize_t batadv_store_isolation_mark(struct kobject *kobj,
674
710
"New skb mark for extended isolation: %#.8x/%#.8x\n" ,
675
711
bat_priv -> isolation_mark , bat_priv -> isolation_mark_mask );
676
712
713
+ batadv_netlink_notify_mesh (bat_priv );
714
+
677
715
return count ;
678
716
}
679
717
@@ -1078,6 +1116,7 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,
1078
1116
struct attribute * attr ,
1079
1117
char * buff , size_t count )
1080
1118
{
1119
+ struct batadv_priv * bat_priv = batadv_kobj_to_batpriv (kobj );
1081
1120
struct net_device * net_dev = batadv_kobj_to_netdev (kobj );
1082
1121
struct batadv_hard_iface * hard_iface ;
1083
1122
u32 tp_override ;
@@ -1108,6 +1147,8 @@ static ssize_t batadv_store_throughput_override(struct kobject *kobj,
1108
1147
1109
1148
atomic_set (& hard_iface -> bat_v .throughput_override , tp_override );
1110
1149
1150
+ batadv_netlink_notify_hardif (bat_priv , hard_iface );
1151
+
1111
1152
out :
1112
1153
batadv_hardif_put (hard_iface );
1113
1154
return count ;
0 commit comments