aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-11-16 06:03:51 -0500
committerAntonio Quartulli <antonio@meshcoding.com>2014-01-08 14:49:45 -0500
commiteceb22ae0bdcb49daff9989f91fb3388fa501a69 (patch)
treec040a5350d949ecbde205968086be5311ea621db /net/batman-adv/main.c
parent2d2fcc2a3ff79de1fa3fba10f88c324d769392af (diff)
batman-adv: create helper function to get AP isolation status
The AP isolation status may be evaluated in different spots. Create an helper function to avoid code duplication. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/main.c')
-rw-r--r--net/batman-adv/main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 8abda424aae3..945e441b579d 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -1171,6 +1171,32 @@ unsigned short batadv_get_vid(struct sk_buff *skb, size_t header_len)
1171 return vid; 1171 return vid;
1172} 1172}
1173 1173
1174/**
1175 * batadv_vlan_ap_isola_get - return the AP isolation status for the given vlan
1176 * @bat_priv: the bat priv with all the soft interface information
1177 * @vid: the VLAN identifier for which the AP isolation attributed as to be
1178 * looked up
1179 *
1180 * Returns true if AP isolation is on for the VLAN idenfied by vid, false
1181 * otherwise
1182 */
1183bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv, unsigned short vid)
1184{
1185 bool ap_isolation_enabled = false;
1186 struct batadv_softif_vlan *vlan;
1187
1188 /* if the AP isolation is requested on a VLAN, then check for its
1189 * setting in the proper VLAN private data structure
1190 */
1191 vlan = batadv_softif_vlan_get(bat_priv, vid);
1192 if (vlan) {
1193 ap_isolation_enabled = atomic_read(&vlan->ap_isolation);
1194 batadv_softif_vlan_free_ref(vlan);
1195 }
1196
1197 return ap_isolation_enabled;
1198}
1199
1174static int batadv_param_set_ra(const char *val, const struct kernel_param *kp) 1200static int batadv_param_set_ra(const char *val, const struct kernel_param *kp)
1175{ 1201{
1176 struct batadv_algo_ops *bat_algo_ops; 1202 struct batadv_algo_ops *bat_algo_ops;