[YANGTOOLS-1284] Cannot parse yexte:initial-value "::" for ipv6 address Created: 04/May/21  Updated: 06/May/21  Resolved: 04/May/21

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: 2.1.18
Fix Version/s: None

Type: Bug Priority: High
Reporter: mikael petterson Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: IPV6
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,

 

leaf ipv6Address {
  description "Eight fields, separated by colons. Each field consists of up to four hexadecimal characters. Value of each field is in range 0-FFFF. Leading zeroes can be omitted in a field, and multiple groups of 16 bits of zeroes can be compressed to :: The :: can appear only once in an address.";
  type inet:ipv6-address-no-zone;
  yexte:initial-value "::";
}

 

 

when we parse this we get a index out of bounds.

If we change it to be "::\0" then parser accepts it.

 

Why is default route ok but not :: ?

 

br,

 

//mikael

 

 

 



 Comments   
Comment by Robert Varga [ 04/May/21 ]

I assume the index out of bounds is something like this:

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils.qnameFromArgument(StmtContextUtils.java:491)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.extension.UnrecognizedEffectiveStatementImpl.<init>(UnrecognizedEffectiveStatementImpl.java:38)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.extension.UnrecognizedStatementSupport.createEffective(UnrecognizedStatementSupport.java:40)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.extension.ModelDefinedStatementSupport.createEffective(ModelDefinedStatementSupport.java:42)
        at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase.buildEffective(StatementContextBase.java:491)
        at com.google.common.collect.Iterators$6.transform(Iterators.java:785)
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
        at java.base/java.util.AbstractCollection.toArray(AbstractCollection.java:144)
        at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:260)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementBase.<init>(EffectiveStatementBase.java:55)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.DeclaredEffectiveStatementBase.<init>(DeclaredEffectiveStatementBase.java:31)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveDocumentedNode.<init>(AbstractEffectiveDocumentedNode.java:34)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractSchemaEffectiveDocumentedNode.<init>(AbstractSchemaEffectiveDocumentedNode.java:42)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveSchemaNode.<init>(AbstractEffectiveSchemaNode.java:28)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveDataSchemaNode.<init>(AbstractEffectiveDataSchemaNode.java:31)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.leaf.LeafEffectiveStatementImpl.<init>(LeafEffectiveStatementImpl.java:47)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.leaf.LeafStatementSupport.createEffective(LeafStatementSupport.java:72)
        at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase.buildEffective(StatementContextBase.java:491)
        at com.google.common.collect.Iterators$6.transform(Iterators.java:785)
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
        at java.base/java.util.AbstractCollection.toArray(AbstractCollection.java:144)
        at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:260)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementBase.<init>(EffectiveStatementBase.java:55)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.DeclaredEffectiveStatementBase.<init>(DeclaredEffectiveStatementBase.java:31)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveDocumentedNode.<init>(AbstractEffectiveDocumentedNode.java:34)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractSchemaEffectiveDocumentedNode.<init>(AbstractSchemaEffectiveDocumentedNode.java:42)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveModule.<init>(AbstractEffectiveModule.java:99)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.module.ModuleEffectiveStatementImpl.<init>(ModuleEffectiveStatementImpl.java:59)
        at org.opendaylight.yangtools.yang.parser.rfc7950.stmt.module.AbstractModuleStatementSupport.createEffective(AbstractModuleStatementSupport.java:64)
        at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase.buildEffective(StatementContextBase.java:491)
        at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.transformEffective(BuildGlobalContext.java:271)

 

Comment by Robert Varga [ 04/May/21 ]

Anyway, yangtools-2.1.x release stream has been desupported for more than a year and this issue is not reproducible in any of the currently-supported releases.

Comment by Robert Varga [ 04/May/21 ]

Not reproducible with yangtools-5.0.9.

Comment by mikael petterson [ 04/May/21 ]

Yes that is the exception we get.

ok I guess we need to upgrade version.  We are currently using:

<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-impl</artifactId>
<version>2.1.18</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-api</artifactId>
<version>2.1.18</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-model-api</artifactId>
<version>2.1.18</version>
<type>jar</type>
</dependency>

 

rovarga does the same jars exist? Or do we need to use others ( If refactoring has been done). And I guess we could go for 6.x.x version?

Are there any major api changes?

 

Comment by Robert Varga [ 05/May/21 ]

Yes, they do exist, 6.0.5 is probably your best bet. Note they require Java 11 and API-wise there have been changes – whether or not they impact you, I cannot tell.

Comment by mikael petterson [ 06/May/21 ]

rovarga I realizes that we are still using jdk 8 ( we are still 5-6 mon from java 11 upgrade). I guess  3.x.x is the last that supports java 8. I the method ok there?

 

Comment by Robert Varga [ 06/May/21 ]

No idea, I have not checked as that release train is no longer supported by the community.

Generated at Wed Feb 07 20:55:42 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.