diff options
| author | David S. Miller <davem@davemloft.net> | 2015-01-19 15:45:16 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-01-19 15:45:16 -0500 |
| commit | cbcd1fa72c7cc4ac5b8c8554731fdb06ac7ddaa8 (patch) | |
| tree | 73b836097d22b1c91acaaa5441180f47756a2658 | |
| parent | 5bdc73800dad3ef5d06977a4b90304bd34353933 (diff) | |
| parent | 8db0a2ee2c6302a1dcbcdb93cb731dfc6c0cdb5e (diff) | |
Merge branch 'dsa-next'
Florian Fainelli says:
====================
net: DSA fixes for bridge and ip-autoconf
These two patches address some real world use cases of the DSA master and slave
network devices.
You have already seen patch 1 previously and you rejected it since my
explanations were not good enough to provide a justification as to why it is
useful, hopefully this time my explanation is better.
Patch 2 solves a different, yet very real problem as well at the bridge layer
when using DSA network devices.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/bridge/br_if.c | 10 | ||||
| -rw-r--r-- | net/ipv4/ipconfig.c | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 81e49fb73169..b087d278c679 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
| @@ -436,10 +436,16 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) | |||
| 436 | int err = 0; | 436 | int err = 0; |
| 437 | bool changed_addr; | 437 | bool changed_addr; |
| 438 | 438 | ||
| 439 | /* Don't allow bridging non-ethernet like devices */ | 439 | /* Don't allow bridging non-ethernet like devices, or DSA-enabled |
| 440 | * master network devices since the bridge layer rx_handler prevents | ||
| 441 | * the DSA fake ethertype handler to be invoked, so we do not strip off | ||
| 442 | * the DSA switch tag protocol header and the bridge layer just return | ||
| 443 | * RX_HANDLER_CONSUMED, stopping RX processing for these frames. | ||
| 444 | */ | ||
| 440 | if ((dev->flags & IFF_LOOPBACK) || | 445 | if ((dev->flags & IFF_LOOPBACK) || |
| 441 | dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN || | 446 | dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN || |
| 442 | !is_valid_ether_addr(dev->dev_addr)) | 447 | !is_valid_ether_addr(dev->dev_addr) || |
| 448 | netdev_uses_dsa(dev)) | ||
| 443 | return -EINVAL; | 449 | return -EINVAL; |
| 444 | 450 | ||
| 445 | /* No bridging of bridges */ | 451 | /* No bridging of bridges */ |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 7fa18bc7e47f..b26376ef87f6 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
| @@ -209,9 +209,9 @@ static int __init ic_open_devs(void) | |||
| 209 | last = &ic_first_dev; | 209 | last = &ic_first_dev; |
| 210 | rtnl_lock(); | 210 | rtnl_lock(); |
| 211 | 211 | ||
| 212 | /* bring loopback device up first */ | 212 | /* bring loopback and DSA master network devices up first */ |
| 213 | for_each_netdev(&init_net, dev) { | 213 | for_each_netdev(&init_net, dev) { |
| 214 | if (!(dev->flags & IFF_LOOPBACK)) | 214 | if (!(dev->flags & IFF_LOOPBACK) && !netdev_uses_dsa(dev)) |
| 215 | continue; | 215 | continue; |
| 216 | if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) | 216 | if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) |
| 217 | pr_err("IP-Config: Failed to open %s\n", dev->name); | 217 | pr_err("IP-Config: Failed to open %s\n", dev->name); |
| @@ -306,7 +306,7 @@ static void __init ic_close_devs(void) | |||
| 306 | while ((d = next)) { | 306 | while ((d = next)) { |
| 307 | next = d->next; | 307 | next = d->next; |
| 308 | dev = d->dev; | 308 | dev = d->dev; |
| 309 | if (dev != ic_dev) { | 309 | if (dev != ic_dev && !netdev_uses_dsa(dev)) { |
| 310 | DBG(("IP-Config: Downing %s\n", dev->name)); | 310 | DBG(("IP-Config: Downing %s\n", dev->name)); |
| 311 | dev_change_flags(dev, d->flags); | 311 | dev_change_flags(dev, d->flags); |
| 312 | } | 312 | } |
