aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/soft-interface.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-11-16 06:03:47 -0500
committerAntonio Quartulli <antonio@meshcoding.com>2014-01-08 14:49:42 -0500
commitc42edfe382fee1c2c74550a5a3cbf50b2a28cf07 (patch)
treebc1f346482e3c6f24b9363d3362e8ee691a30e4b /net/batman-adv/soft-interface.c
parent6c413b1c22a2c4ef324f1c6f2c282f1ca10a93b9 (diff)
batman-adv: add isolation_mark sysfs attribute
This attribute can be used to set and read the value and the mask of the skb mark which will be used to classify the source non-mesh client as ISOLATED. In this way a client can be advertised as such and the mark can potentially be restored at the receiving node before delivering the skb. This can be helpful for creating network wide netfilter policies. This sysfs file expects a string of the shape "$mark/$mask". Where $mark has to be a 32-bit number in any base, while $mask must be a 32bit mask expressed in hex base. Only bits in $mark covered by the bitmask are really stored. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/soft-interface.c')
-rw-r--r--net/batman-adv/soft-interface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b569932ddcc4..35a82e36c003 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -701,6 +701,8 @@ static int batadv_softif_init_late(struct net_device *dev)
701#endif 701#endif
702 bat_priv->tt.last_changeset = NULL; 702 bat_priv->tt.last_changeset = NULL;
703 bat_priv->tt.last_changeset_len = 0; 703 bat_priv->tt.last_changeset_len = 0;
704 bat_priv->isolation_mark = 0;
705 bat_priv->isolation_mark_mask = 0;
704 706
705 /* randomize initial seqno to avoid collision */ 707 /* randomize initial seqno to avoid collision */
706 get_random_bytes(&random_seqno, sizeof(random_seqno)); 708 get_random_bytes(&random_seqno, sizeof(random_seqno));