aboutsummaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorScott Feldman <[email protected]>2015-07-18 18:24:49 -0700
committerDavid S. Miller <[email protected]>2015-07-20 18:32:44 -0700
commitd754f98b502ad9a8c7570d494e1eaa0e6bc0350c (patch)
treec26da1c040abc3d26d7f01e236f947c78fe4d145 /net/switchdev/switchdev.c
parent0c4f691ff6791e55ac831666df0b49b1679c56e4 (diff)
net: add phys ID compare helper to test if two IDs are the same
Signed-off-by: Scott Feldman <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 9f2add3cba26..4e5bba50ccff 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -910,13 +910,9 @@ static struct net_device *switchdev_get_dev_by_nhs(struct fib_info *fi)
if (switchdev_port_attr_get(dev, &attr))
return NULL;
- if (nhsel > 0) {
- if (prev_attr.u.ppid.id_len != attr.u.ppid.id_len)
+ if (nhsel > 0 &&
+ !netdev_phys_item_id_same(&prev_attr.u.ppid, &attr.u.ppid))
return NULL;
- if (memcmp(prev_attr.u.ppid.id, attr.u.ppid.id,
- attr.u.ppid.id_len))
- return NULL;
- }
prev_attr = attr;
}