diff --git a/nest/locks.c b/nest/locks.c
index 812a6534..3d54f0f4 100644
--- a/nest/locks.c
+++ b/nest/locks.c
@@ -39,6 +39,11 @@
 static list olock_list;
 static event *olock_event;
 
+static inline int ipa_equal_wildcard(ip_addr x, ip_addr y)
+{
+  return ipa_zero(x) || ipa_zero(y) || ipa_equal(x, y);
+}
+
 static inline int
 olock_same(struct object_lock *x, struct object_lock *y)
 {
@@ -48,7 +53,8 @@ olock_same(struct object_lock *x, struct object_lock *y)
     x->vrf == y->vrf &&
     x->port == y->port &&
     x->inst == y->inst &&
-    ipa_equal(x->addr, y->addr);
+    ipa_equal(x->addr_strict, y->addr_strict) &&
+    ipa_equal_wildcard(x->addr_wildcard, y->addr_wildcard);
 }
 
 static void
@@ -91,7 +97,7 @@ olock_dump(resource *r)
   struct object_lock *l = (struct object_lock *) r;
   static char *olock_states[] = { "free", "locked", "waiting", "event" };
 
-  debug("(%d:%s:%I:%d:%d) [%s]\n", l->type, (l->iface ? l->iface->name : "?"), l->addr, l->port, l->inst, olock_states[l->state]);
+  debug("(%d:%s:%I:%I:%d:%d) [%s]\n", l->type, (l->iface ? l->iface->name : "?"), l->addr_strict, l->addr_wildcard, l->port, l->inst, olock_states[l->state]);
   if (!EMPTY_LIST(l->waiters))
     debug(" [wanted]\n");
 }
diff --git a/nest/locks.h b/nest/locks.h
index 37026c68..e68321ae 100644
--- a/nest/locks.h
+++ b/nest/locks.h
@@ -25,7 +25,8 @@
 
 struct object_lock {
   resource r;
-  ip_addr addr;		/* Identification of a object: IP address */
+  ip_addr addr_strict;	/* Identification of a object: IP address (strict compare) */
+  ip_addr addr_wildcard;	/* ... another IP address (allow zero IP wildcard) */
   uint type;		/* ... object type (OBJLOCK_xxx) */
   uint port;		/* ... port number */
   uint inst;		/* ... instance ID */
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 4187d258..113781d4 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -1932,7 +1932,7 @@ babel_add_iface(struct babel_proto *p, struct iface *new, struct babel_iface_con
 
   struct object_lock *lock = olock_new(ifa->pool);
   lock->type = OBJLOCK_UDP;
-  lock->addr = IP6_BABEL_ROUTERS;
+  lock->addr_strict = IP6_BABEL_ROUTERS;
   lock->port = ifa->cf->port;
   lock->iface = ifa->iface;
   lock->hook = babel_iface_locked;
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 9d4671af..33e869d4 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1615,7 +1615,8 @@ bgp_start(struct proto *P)
    */
   struct object_lock *lock;
   lock = p->lock = olock_new(P->pool);
-  lock->addr = p->remote_ip;
+  lock->addr_strict = p->remote_ip;
+  lock->addr_wildcard = p->cf->local_ip;
   lock->port = p->cf->remote_port;
   lock->iface = p->cf->iface;
   lock->vrf = p->cf->iface ? NULL : p->p.vrf;
@@ -1626,7 +1627,7 @@ bgp_start(struct proto *P)
   /* For dynamic BGP, we use inst 1 to avoid collisions with regular BGP */
   if (bgp_is_dynamic(p))
   {
-    lock->addr = net_prefix(p->cf->remote_range);
+    lock->addr_strict = net_prefix(p->cf->remote_range);
     lock->inst = 1;
   }
 
diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c
index dd922b00..cf26cf28 100644
--- a/proto/ospf/iface.c
+++ b/proto/ospf/iface.c
@@ -663,7 +663,7 @@ ospf_iface_new(struct ospf_area *oa, struct ifa *addr, struct ospf_iface_patt *i
   add_tail(&oa->po->iface_list, NODE ifa);
 
   struct object_lock *lock = olock_new(pool);
-  lock->addr = ospf_is_v2(p) ? ipa_from_ip4(net4_prefix(&ifa->addr->prefix)) : IPA_NONE;
+  lock->addr_strict = ospf_is_v2(p) ? ipa_from_ip4(net4_prefix(&ifa->addr->prefix)) : IPA_NONE;
   lock->type = OBJLOCK_IP;
   lock->port = OSPF_PROTO;
   lock->inst = ifa->instance_id;
