diff options
Diffstat (limited to 'drivers/net/geneve.c')
-rw-r--r-- | drivers/net/geneve.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index ed51018a813e..5ec39f113127 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -1134,24 +1134,11 @@ static struct geneve_dev *geneve_find_dev(struct geneve_net *gn, return t; } -static bool is_all_zero(const u8 *fp, size_t size) -{ - int i; - - for (i = 0; i < size; i++) - if (fp[i]) - return false; - return true; -} - static bool is_tnl_info_zero(const struct ip_tunnel_info *info) { - if (info->key.tun_id || info->key.tun_flags || info->key.tos || - info->key.ttl || info->key.label || info->key.tp_src || - !is_all_zero((const u8 *)&info->key.u, sizeof(info->key.u))) - return false; - else - return true; + return !(info->key.tun_id || info->key.tun_flags || info->key.tos || + info->key.ttl || info->key.label || info->key.tp_src || + memchr_inv(&info->key.u, 0, sizeof(info->key.u))); } static bool geneve_dst_addr_equal(struct ip_tunnel_info *a, |