#include "addr.h"
 #include "core.h"
 
-/**
- * in_own_cluster - test for cluster inclusion; <0.0.0> always matches
- */
-int in_own_cluster(struct net *net, u32 addr)
-{
-       return in_own_cluster_exact(net, addr) || !addr;
-}
-
-int in_own_cluster_exact(struct net *net, u32 addr)
-{
-       struct tipc_net *tn = net_generic(net, tipc_net_id);
-
-       return !((addr ^ tn->own_addr) >> 12);
-}
-
 /**
  * in_own_node - test for node inclusion; <0.0.0> always matches
  */
        return (addr == tn->own_addr) || !addr;
 }
 
-/**
- * tipc_addr_domain_valid - validates a network domain address
- *
- * Accepts <Z.C.N>, <Z.C.0>, <Z.0.0>, and <0.0.0>,
- * where Z, C, and N are non-zero.
- *
- * Returns 1 if domain address is valid, otherwise 0
- */
-int tipc_addr_domain_valid(u32 addr)
-{
-       u32 n = tipc_node(addr);
-       u32 c = tipc_cluster(addr);
-       u32 z = tipc_zone(addr);
-
-       if (n && (!z || !c))
-               return 0;
-       if (c && !z)
-               return 0;
-       return 1;
-}
-
-/**
- * tipc_addr_node_valid - validates a proposed network address for this node
- *
- * Accepts <Z.C.N>, where Z, C, and N are non-zero.
- *
- * Returns 1 if address can be used, otherwise 0
- */
-int tipc_addr_node_valid(u32 addr)
-{
-       return tipc_addr_domain_valid(addr) && tipc_node(addr);
-}
-
 int tipc_in_scope(u32 domain, u32 addr)
 {
        if (!domain || (domain == addr))
                return 1;
        if (domain == tipc_cluster_mask(addr)) /* domain <Z.C.0> */
                return 1;
-       if (domain == tipc_zone_mask(addr)) /* domain <Z.0.0> */
+       if (domain == (addr & TIPC_ZONE_MASK)) /* domain <Z.0.0> */
                return 1;
        return 0;
 }
 
        return tn->own_addr;
 }
 
-static inline u32 tipc_zone_mask(u32 addr)
-{
-       return addr & TIPC_ZONE_MASK;
-}
-
 static inline u32 tipc_cluster_mask(u32 addr)
 {
        return addr & TIPC_ZONE_CLUSTER_MASK;
 }
 
 u32 tipc_own_addr(struct net *net);
-int in_own_cluster(struct net *net, u32 addr);
-int in_own_cluster_exact(struct net *net, u32 addr);
 int in_own_node(struct net *net, u32 addr);
-u32 addr_domain(struct net *net, u32 sc);
-int tipc_addr_domain_valid(u32);
-int tipc_addr_node_valid(u32 addr);
 int tipc_in_scope(u32 domain, u32 addr);
-int tipc_addr_scope(u32 domain);
 char *tipc_addr_string_fill(char *string, u32 addr);
 
 #endif
 
        struct tipc_bearer *b;
        struct tipc_media *m;
        struct sk_buff *skb;
-       char addr_string[16];
        int bearer_id = 0;
        int res = -EINVAL;
        char *errstr = "";
                goto rejected;
        }
 
-       if (tipc_addr_domain_valid(disc_domain) && disc_domain != self) {
-               if (tipc_in_scope(disc_domain, self)) {
-                       /* Accept any node in own cluster */
-                       disc_domain = self & TIPC_ZONE_CLUSTER_MASK;
-                       res = 0;
-               } else if (in_own_cluster_exact(net, disc_domain)) {
-                       /* Accept specified node in own cluster */
-                       res = 0;
-               }
-       }
-       if (res) {
-               errstr = "illegal discovery domain";
-               goto rejected;
-       }
-
        if (prio > TIPC_MAX_LINK_PRI && prio != TIPC_MEDIA_LINK_PRI) {
                errstr = "illegal priority";
                goto rejected;
                return -ENOMEM;
        }
 
-       tipc_addr_string_fill(addr_string, disc_domain);
-       pr_info("Enabled bearer <%s>, discovery scope %s, priority %u\n",
-               name, addr_string, prio);
+       pr_info("Enabled bearer <%s>, priority %u\n", name, prio);
+
        return res;
 rejected:
-       pr_warn("Bearer <%s> rejected, %s\n", name, errstr);
+       pr_warn("Enabling of bearer <%s> rejected, %s\n", name, errstr);
        return res;
 }
 
        char *bearer;
        struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1];
        struct net *net = sock_net(skb->sk);
-       struct tipc_net *tn = net_generic(net, tipc_net_id);
-       u32 domain;
+       u32 domain = 0;
        u32 prio;
 
        prio = TIPC_MEDIA_LINK_PRI;
-       domain = tn->own_addr & TIPC_ZONE_CLUSTER_MASK;
 
        if (!info->attrs[TIPC_NLA_BEARER])
                return -EINVAL;
 
                return;
        if (net_id != tn->net_id)
                return;
-       if (!tipc_addr_domain_valid(dst))
-               return;
-       if (!tipc_addr_node_valid(src))
-               return;
        if (in_own_node(net, src)) {
                disc_dupl_alert(b, self, &maddr);
                return;
        }
-       if (!tipc_in_scope(dst, self))
-               return;
-       if (!tipc_in_scope(b->domain, src))
-               return;
+       /* Domain filter only works if both peers use legacy address format */
+       if (b->domain) {
+               if (!tipc_in_scope(dst, self))
+                       return;
+               if (!tipc_in_scope(b->domain, src))
+                       return;
+       }
        tipc_node_check_dest(net, src, b, caps, signature,
                             &maddr, &respond, &dupl_addr);
        if (dupl_addr)
 
  */
 bool tipc_link_create(struct net *net, char *if_name, int bearer_id,
                      int tolerance, char net_plane, u32 mtu, int priority,
-                     int window, u32 session, u32 ownnode, u32 peer,
+                     int window, u32 session, u32 self, u32 peer,
                      u16 peer_caps,
                      struct tipc_link *bc_sndlink,
                      struct tipc_link *bc_rcvlink,
        l->session = session;
 
        /* Note: peer i/f name is completed by reset/activate message */
-       sprintf(l->name, "%u.%u.%u:%s-%u.%u.%u:unknown",
-               tipc_zone(ownnode), tipc_cluster(ownnode), tipc_node(ownnode),
-               if_name, tipc_zone(peer), tipc_cluster(peer), tipc_node(peer));
+       sprintf(l->name, "%x:%s-%x:unknown", self, if_name, peer);
        strcpy(l->if_name, if_name);
        l->addr = peer;
        l->peer_caps = peer_caps;
 
                             TIPC_CLUSTER_SCOPE, 0, tn->own_addr);
 
        pr_info("Started in network mode\n");
-       pr_info("Own node address %s, network identity %u\n",
+       pr_info("Own node address %s, cluster identity %u\n",
                tipc_addr_string_fill(addr_string, tn->own_addr),
                tn->net_id);
        return 0;
                        return -EPERM;
 
                addr = nla_get_u32(attrs[TIPC_NLA_NET_ADDR]);
-               if (!tipc_addr_node_valid(addr))
+               if (!addr)
                        return -EINVAL;
 
                tipc_net_start(net, addr);
 
        struct tipc_node *node;
        unsigned int thash = tipc_hashfn(addr);
 
-       if (unlikely(!in_own_cluster_exact(net, addr)))
-               return NULL;
-
        rcu_read_lock();
        hlist_for_each_entry_rcu(node, &tn->node_htable[thash], hash) {
                if (node->addr != addr)
 
        /* Now create new link if not already existing */
        if (!l) {
-               if (n->link_cnt == 2) {
-                       pr_warn("Cannot establish 3rd link to %x\n", n->addr);
+               if (n->link_cnt == 2)
                        goto exit;
-               }
+
                if_name = strchr(b->name, ':') + 1;
                if (!tipc_link_create(net, if_name, b->identity, b->tolerance,
                                      b->net_plane, b->mtu, b->priority,
 
        TIPC_BCAST_STATE_NACK = (1 << 2),
        TIPC_BLOCK_FLOWCTL    = (1 << 3),
        TIPC_BCAST_RCAST      = (1 << 4),
-       TIPC_MCAST_GROUPS     = (1 << 5)
+       TIPC_NODE_ID32        = (1 << 5)
 };
 
 #define TIPC_NODE_CAPABILITIES (TIPC_BCAST_SYNCH | \
                                TIPC_BCAST_STATE_NACK | \
                                TIPC_BCAST_RCAST | \
-                               TIPC_BLOCK_FLOWCTL)
+                               TIPC_BLOCK_FLOWCTL | \
+                               TIPC_NODE_ID32)
 #define INVALID_BEARER_ID -1
 
 void tipc_node_stop(struct net *net);