diff options
Diffstat (limited to 'net/bridge/br_sysfs_if.c')
-rw-r--r-- | net/bridge/br_sysfs_if.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index 820643a3ba9c..0b9916489d6b 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c | |||
@@ -159,6 +159,21 @@ static ssize_t store_hairpin_mode(struct net_bridge_port *p, unsigned long v) | |||
159 | static BRPORT_ATTR(hairpin_mode, S_IRUGO | S_IWUSR, | 159 | static BRPORT_ATTR(hairpin_mode, S_IRUGO | S_IWUSR, |
160 | show_hairpin_mode, store_hairpin_mode); | 160 | show_hairpin_mode, store_hairpin_mode); |
161 | 161 | ||
162 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | ||
163 | static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) | ||
164 | { | ||
165 | return sprintf(buf, "%d\n", p->multicast_router); | ||
166 | } | ||
167 | |||
168 | static ssize_t store_multicast_router(struct net_bridge_port *p, | ||
169 | unsigned long v) | ||
170 | { | ||
171 | return br_multicast_set_port_router(p, v); | ||
172 | } | ||
173 | static BRPORT_ATTR(multicast_router, S_IRUGO | S_IWUSR, show_multicast_router, | ||
174 | store_multicast_router); | ||
175 | #endif | ||
176 | |||
162 | static struct brport_attribute *brport_attrs[] = { | 177 | static struct brport_attribute *brport_attrs[] = { |
163 | &brport_attr_path_cost, | 178 | &brport_attr_path_cost, |
164 | &brport_attr_priority, | 179 | &brport_attr_priority, |
@@ -176,6 +191,9 @@ static struct brport_attribute *brport_attrs[] = { | |||
176 | &brport_attr_hold_timer, | 191 | &brport_attr_hold_timer, |
177 | &brport_attr_flush, | 192 | &brport_attr_flush, |
178 | &brport_attr_hairpin_mode, | 193 | &brport_attr_hairpin_mode, |
194 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | ||
195 | &brport_attr_multicast_router, | ||
196 | #endif | ||
179 | NULL | 197 | NULL |
180 | }; | 198 | }; |
181 | 199 | ||
@@ -220,7 +238,7 @@ static ssize_t brport_store(struct kobject * kobj, | |||
220 | return ret; | 238 | return ret; |
221 | } | 239 | } |
222 | 240 | ||
223 | struct sysfs_ops brport_sysfs_ops = { | 241 | const struct sysfs_ops brport_sysfs_ops = { |
224 | .show = brport_show, | 242 | .show = brport_show, |
225 | .store = brport_store, | 243 | .store = brport_store, |
226 | }; | 244 | }; |