diff --git a/drivers/net/ovpn-dco/peer.c b/drivers/net/ovpn-dco/peer.c
index cecbbb4..aee9f11 100644
--- a/drivers/net/ovpn-dco/peer.c
+++ b/drivers/net/ovpn-dco/peer.c
@@ -355,14 +355,11 @@ static struct ovpn_peer *ovpn_peer_lookup_vpn_addr4(struct hlist_head *head, __b
 static struct ovpn_peer *ovpn_peer_lookup_vpn_addr6(struct hlist_head *head, struct in6_addr *addr)
 {
 	struct ovpn_peer *tmp, *peer = NULL;
-	int i;
 
 	rcu_read_lock();
 	hlist_for_each_entry_rcu(tmp, head, hash_entry_addr6) {
-		for (i = 0; i < 4; i++) {
-			if (addr->s6_addr32[i] != tmp->vpn_addrs.ipv6.s6_addr32[i])
-				continue;
-		}
+		if (!ipv6_addr_equal(addr, &tmp->vpn_addrs.ipv6))
+			continue;
 
 		if (!ovpn_peer_hold(tmp))
 			continue;
