diff options
Diffstat (limited to 'net/bridge/br_sysfs_if.c')
-rw-r--r-- | net/bridge/br_sysfs_if.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index 4a3cdf8f3813..820643a3ba9c 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c | |||
@@ -143,6 +143,22 @@ static ssize_t store_flush(struct net_bridge_port *p, unsigned long v) | |||
143 | } | 143 | } |
144 | static BRPORT_ATTR(flush, S_IWUSR, NULL, store_flush); | 144 | static BRPORT_ATTR(flush, S_IWUSR, NULL, store_flush); |
145 | 145 | ||
146 | static ssize_t show_hairpin_mode(struct net_bridge_port *p, char *buf) | ||
147 | { | ||
148 | int hairpin_mode = (p->flags & BR_HAIRPIN_MODE) ? 1 : 0; | ||
149 | return sprintf(buf, "%d\n", hairpin_mode); | ||
150 | } | ||
151 | static ssize_t store_hairpin_mode(struct net_bridge_port *p, unsigned long v) | ||
152 | { | ||
153 | if (v) | ||
154 | p->flags |= BR_HAIRPIN_MODE; | ||
155 | else | ||
156 | p->flags &= ~BR_HAIRPIN_MODE; | ||
157 | return 0; | ||
158 | } | ||
159 | static BRPORT_ATTR(hairpin_mode, S_IRUGO | S_IWUSR, | ||
160 | show_hairpin_mode, store_hairpin_mode); | ||
161 | |||
146 | static struct brport_attribute *brport_attrs[] = { | 162 | static struct brport_attribute *brport_attrs[] = { |
147 | &brport_attr_path_cost, | 163 | &brport_attr_path_cost, |
148 | &brport_attr_priority, | 164 | &brport_attr_priority, |
@@ -159,6 +175,7 @@ static struct brport_attribute *brport_attrs[] = { | |||
159 | &brport_attr_forward_delay_timer, | 175 | &brport_attr_forward_delay_timer, |
160 | &brport_attr_hold_timer, | 176 | &brport_attr_hold_timer, |
161 | &brport_attr_flush, | 177 | &brport_attr_flush, |
178 | &brport_attr_hairpin_mode, | ||
162 | NULL | 179 | NULL |
163 | }; | 180 | }; |
164 | 181 | ||