NETVIRT 1202 : AS number issue during display 95/70695/6
authorLoshmitha <loshmitha@ericsson.com>
Tue, 10 Apr 2018 07:19:32 +0000 (12:49 +0530)
committerSam Hague <shague@redhat.com>
Wed, 30 May 2018 16:20:48 +0000 (16:20 +0000)
Value of AS number was an integer which gave rise to negative values so
changing it to long to increase the range of the value
Signed-off-by: Loshmitha <loshmitha@ericsson.com>
Change-Id: I587cd867e55a0535d09b1c3b082fe71455c20eff
Signed-off-by: Loshmitha <loshmitha@ericsson.com>
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Cache.java
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Neighbor.java
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/commands/Router.java

index 9799643e3105941ff888f53572474309dfb1f69b..e68573a15758d7e5788643654683ac9e62be6055 100644 (file)
@@ -149,7 +149,7 @@ public class Cache extends OsgiCommandSupport {
         }
         AsId asId = config.getAsId();
         if (asId != null) {
-            int asNum = asId.getLocalAs().intValue();
+            long asNum = asId.getLocalAs().longValue();
             IpAddress routerId = asId.getRouterId();
             Long spt = asId.getStalepathTime();
             Boolean afb = asId.isAnnounceFbit();
@@ -179,7 +179,7 @@ public class Cache extends OsgiCommandSupport {
             ps.printf("%nNeighbors%n");
             for (Neighbors nbr : neighbors) {
                 ps.printf("\t%s%n\t\t%-16s  %d%n", nbr.getAddress().getValue(),
-                        ASSTR, nbr.getRemoteAs().intValue());
+                        ASSTR, nbr.getRemoteAs());
                 EbgpMultihop en = nbr.getEbgpMultihop();
                 if (en != null) {
                     ps.printf("\t\t%-16s  %d%n", EBSTR, en.getNhops().intValue());
index edddf7a6fec81f9d861c91c023a05a1dabfc2961..6bf1433f12690b8f903e231867ef4c23ae2ca5a6 100644 (file)
@@ -99,11 +99,11 @@ public class Neighbor extends OsgiCommandSupport {
                     return null;
                 }
                 if (asNum != null) {
-                    if (!Commands.isValid(session.getConsole(), asNum, Commands.Validators.INT, AS)) {
+                    if (!Commands.isValid(session.getConsole(), asNum, Commands.Validators.ASNUM, AS)) {
                         return null;
-                    } else {
-                        asn = Long.parseLong(asNum);
                     }
+                    asn = Long.parseLong(asNum);
+
                 }
                 TcpMd5SignaturePasswordType md5Secret = null;
                 if (md5PasswordOption != null) {
index e250107a2b205bc9502d915778e88abf12168b26..1dffc37ec2bba19a5f333187fe5a3d5b93706686 100644 (file)
@@ -74,7 +74,7 @@ public class Router extends OsgiCommandSupport {
                     session.getConsole().println("error: " + AS + " is needed");
                     return null;
                 }
-                if (!Commands.isValid(session.getConsole(), asNum, Commands.Validators.INT, AS)) {
+                if (!Commands.isValid(session.getConsole(), asNum, Commands.Validators.ASNUM, AS)) {
                     return null;
                 }
                 asn = Long.parseLong(asNum);