Skip to content

Commit a55701c

Browse files
garbergfredsod
authored andcommitted
nso-nipap: Handle IPv6 in addHostPrefixFromPrefix
Updated the addHostPrefixFromPrefix function to set the host prefix prefix length based on IP version.
1 parent 3f0d561 commit a55701c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nso-nipap/nso-nipap/src/java/src/net/spritelink/nsonipap/ConfigCdbSub.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ protected void addHostPrefixFromPrefix(String path, Prefix parentPrefix) throws
9090
LOGGER.info("Create, From prefix request, path = " + path);
9191

9292
AddPrefixOptions child_opts = new AddPrefixOptions();
93-
child_opts.put("prefix_length", "32");
93+
if (parentPrefix.family.intValue() == 4) {
94+
child_opts.put("prefix_length", "32");
95+
} else {
96+
child_opts.put("prefix_length", "128");
97+
}
9498

9599
Prefix child_prefix = new Prefix();
96100
child_prefix = getPrefixAttributesFromCDB(path + "/" + nipap._attributes_ );

0 commit comments

Comments
 (0)