Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex option definition types are not parsed into option map, causing NPE on request processing #73

Closed
agrabil opened this issue Dec 11, 2022 · 0 comments
Labels

Comments

@agrabil
Copy link
Contributor

agrabil commented Dec 11, 2022

When we configure v4 and/or v6 options (using subOptions or vxOtherOptions) for anything other than 'string' the DHCP server throws an exception (null pointer) when trying to service a request that asks for that option. No matter which type we use (ipAddress, opaqueDataOption, opaqueDataOptionList). If we set to string, it works without issue, for any of the others it throws what looks like the same exception. We have tried with the examples from the documentation (copy/paste) and see the same behavior.

This is reproducible every time.

Here is an example of the xml file, with the exception below:
(this works)

Remote IPv6 Client Link (Unicast/Multicast traffic) fd78::0000/64 fd00::71 [sdsdev.com](http://sdsdev.com/).                                                 fd78:0000:0000:0000:0000:0000:0000:0071                                    

(this doesn't-we tried short & long notation for the IP, also same problem with V4, and with all the different data types-ip, opaque, ip list, opaque list, etc)

Remote IPv6 Client Link (Unicast/Multicast traffic) fd78::0000/64 fd00::71 [sdsdev.com](http://sdsdev.com/).                                                 fd78:0000:0000:0000:0000:0000:0000:0071                                    

From the server log:

2022-12-09 07:35:33,010 [unorderedThreadPoolEventExecutor-1-9] DEBUG netty.DhcpV6ChannelHandler - Received:
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
MSG_DHCPOPTIONSRelay Message:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG netty.DhcpV6PacketDecoder - Received datagram packet: localChannel=fd00:0:0:0:0:0:0:71:547 remoteSender=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] INFO netty.DhcpV6UnicastChannelDecoder - Decoding unicast message: local=fd00:0:0:0:0:0:0:71:547 remote=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding packet: size=72 localAddr=fd00:0:0:0:0:0:0:71:547 remoteAddr=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Message type byte=12
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - Decoding DhcpRelayMessage from: /fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - MessageType=Relay-Forward
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - HopCount=0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - LinkAddress: /fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - PeerAddress: /fe80:0:0:0:72b3:d5ff:feeb:2a84
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=9
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding packet: size=34 localAddr=fd78:0:0:0:0:0:0:0:547 remoteAddr=fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Message type byte=11
2022-12-09 07:35:33,010 [unorderedThreadPoolEventExecutor-1-9] INFO request.DhcpV6MessageHandler - Handling relay forward on link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] INFO request.DhcpV6MessageHandler - Handling client request on remote client link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] DEBUG config.DhcpServerConfiguration - Looking for Link by remote global address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding DhcpMessage from: fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - MessageType=Info-Request
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - TransactionId=9297445
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=1
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] INFO config.DhcpServerConfiguration - Found configured Link for client request: Remote IPv6 Client Link (Unicast/Multicast traffic)
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=8
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=6
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - DhcpMessage decoded.
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - DhcpRelayMessage decoded.
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] INFO netty.DhcpV6UnicastChannelDecoder - Unicast message decoded: msg=
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] DEBUG request.BaseDhcpV6Processor - Processing:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=0003000170b3d5eb2a84
DhcpV6OptionRequestOption: unsignedShortList=83,23,184
DhcpV6ElapsedTimeOption: unsignedShort=223
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG netty.DhcpV6ChannelHandler - Received:
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
MSG_DHCPOPTIONSRelay Message:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO request.DhcpV6MessageHandler - Handling relay forward on link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO request.DhcpV6MessageHandler - Handling client request on remote client link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG config.DhcpServerConfiguration - Looking for Link by remote global address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO config.DhcpServerConfiguration - Found configured Link for client request: Remote IPv6 Client Link (Unicast/Multicast traffic)
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG request.BaseDhcpV6Processor - Processing:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=0003000170b3d5eb2a84
DhcpV6OptionRequestOption: unsignedShortList=83,23,184
DhcpV6ElapsedTimeOption: unsignedShort=223
2022-12-09 07:35:33,013 [nioEventLoopGroup-5-1] WARN channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException: null
      at com.jagornet.dhcp.core.message.DhcpV6Message.toStringWithOptions(DhcpV6Message.java:666) ~[jagornet-dhcp-core-4.0.0.jar:?]
      at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:207) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleRelayForward(DhcpV6MessageHandler.java:131) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:81) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.channelRead0(DhcpV6ChannelHandler.java:85) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.channelRead0(DhcpV6ChannelHandler.java:55) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.util.concurrent.UnorderedThreadPoolEventExecutor$NonNotifyRunnable.run(UnorderedThreadPoolEventExecutor.java:277) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_351]
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.48.Final.jar:4.1.48.Final]
      at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant