summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/dsa/dsa2.c8
-rw-r--r--net/dsa/tag_dsa.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 01a8efcaabac..4915abe0d4d2 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -86,13 +86,13 @@ void dsa_lag_map(struct dsa_switch_tree *dst, struct net_device *lag_dev)
{
unsigned int id;
- if (dsa_lag_id(dst, lag_dev) >= 0)
+ if (dsa_lag_id(dst, lag_dev) > 0)
/* Already mapped */
return;
- for (id = 0; id < dst->lags_len; id++) {
+ for (id = 1; id <= dst->lags_len; id++) {
if (!dsa_lag_dev(dst, id)) {
- dst->lags[id] = lag_dev;
+ dst->lags[id - 1] = lag_dev;
return;
}
}
@@ -124,7 +124,7 @@ void dsa_lag_unmap(struct dsa_switch_tree *dst, struct net_device *lag_dev)
dsa_lags_foreach_id(id, dst) {
if (dsa_lag_dev(dst, id) == lag_dev) {
- dst->lags[id] = NULL;
+ dst->lags[id - 1] = NULL;
break;
}
}
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index 8abf39dcac64..26435bc4a098 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c
@@ -251,7 +251,7 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev,
* so we inject the frame directly on the upper
* team/bond.
*/
- skb->dev = dsa_lag_dev(cpu_dp->dst, source_port);
+ skb->dev = dsa_lag_dev(cpu_dp->dst, source_port + 1);
} else {
skb->dev = dsa_master_find_slave(dev, source_device,
source_port);