diff options
author | Scott Feldman <sfeldma@gmail.com> | 2015-07-18 21:24:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-20 21:32:44 -0400 |
commit | d754f98b502ad9a8c7570d494e1eaa0e6bc0350c (patch) | |
tree | c26da1c040abc3d26d7f01e236f947c78fe4d145 /net/switchdev | |
parent | 0c4f691ff6791e55ac831666df0b49b1679c56e4 (diff) |
net: add phys ID compare helper to test if two IDs are the same
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
-rw-r--r-- | net/switchdev/switchdev.c | 8 |
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) | |||
910 | if (switchdev_port_attr_get(dev, &attr)) | 910 | if (switchdev_port_attr_get(dev, &attr)) |
911 | return NULL; | 911 | return NULL; |
912 | 912 | ||
913 | if (nhsel > 0) { | 913 | if (nhsel > 0 && |
914 | if (prev_attr.u.ppid.id_len != attr.u.ppid.id_len) | 914 | !netdev_phys_item_id_same(&prev_attr.u.ppid, &attr.u.ppid)) |
915 | return NULL; | 915 | return NULL; |
916 | if (memcmp(prev_attr.u.ppid.id, attr.u.ppid.id, | ||
917 | attr.u.ppid.id_len)) | ||
918 | return NULL; | ||
919 | } | ||
920 | 916 | ||
921 | prev_attr = attr; | 917 | prev_attr = attr; |
922 | } | 918 | } |