Code Monkey home page Code Monkey logo

dhcp's People

Contributors

agrabil avatar dependabot[bot] avatar marosmars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dhcp's Issues

Pool reconciliation logic is flawed

The logic for reconciling the lease database against the configured pools at server startup is broken. It is performed on a per manager basis, which would obliterate leases managed by other managers. Note the TODO comment in V6AddrBindingManager.buildBindingPools.

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

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]

Unable to specify only one IPv4 unicast address

I have many network interfaces on a server machine, and I want to be able to configure Jagornet to act as a DHCP server for a network that is attached to just one of those interfaces. Currently if a single IP address is provided to the --v4ucast parameter, Jagornet does not start successfully.

It looks like it is due to the following code, that parses the options. The case of specifying just one IPv4 unicast address results in a null value for v4UcastAddrs.

Update default logging configuration

The default log4j2 configuration will create a "${jagornet.dhcp.home}" directory if it the system property is not defined.
Also, the default file appender has seemingly backwards index naming convention.

bin/dhcpserver script throws exceptions on version, list-interfaces, and test-configfile options

The version, list-interfaces, and test-configfile options of the bin/dhcpserver script throw Java exceptions when trying to start Log4J, but otherwise work. For example, the output from running 'bin/dhcpserver version':

bin/dhcpserver version
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /log/dhcpserver.log (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:142)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
at org.apache.log4j.LogManager.(LogManager.java:127)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
at com.jagornet.dhcp.server.JagornetDhcpServer.(JagornetDhcpServer.java:87)
Jagornet DHCP Server Community Edition 2.0.0
Copyright Jagornet Technologies, LLC 2009-2014. All Rights Reserved.

Server throws java.lang.Error on startup

v2.0.3 builds include incompatible jar files, resulting in failed server startup.

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method getLinkList() is undefined for the type LinksType

at com.jagornet.dhcp.server.config.DhcpServerConfiguration.initLinkMap(DhcpServerConfiguration.java:222)
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.<init>(DhcpServerConfiguration.java:169)
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.getInstance(DhcpServerConfiguration.java:142)
at com.jagornet.dhcp.server.JagornetDhcpServer.start(JagornetDhcpServer.java:184)
at com.jagornet.dhcp.server.JagornetDhcpServer.main(JagornetDhcpServer.java:944)

2016-06-17 23:58:58,907 [Thread-0] INFO com.jagornet.dhcp.server.JagornetDhcpServer - Stopping Jagornet DHCPv6 Server
Stopping Jagornet DHCPv6 Server: Fri Jun 17 23:58:58 EDT 2016

ClassCastException when DHCPv6 packet received on local multicast channel

DHCPv6 client request received on local multicast IPv6 channel:

2016-06-19 23:34:16,458 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Decoding packet: size=52 localAddr=fe80:0:0:0:1311:11ff:fe11:1111%eth5:547 remoteAddr=fe80:0:0:0:2022:22ff:fe22:2222%17:546
2016-06-19 23:34:16,461 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Message type byte=1
2016-06-19 23:34:16,461 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Decoding DhcpMessage from: fe80:0:0:0:2022:22ff:fe22:2222%17:546
2016-06-19 23:34:16,461 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - MessageType=Solicit
2016-06-19 23:34:16,465 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - TransactionId=2636585
2016-06-19 23:34:16,465 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=1
2016-06-19 23:34:16,469 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG base.BaseDhcpOption - DhcpV6ClientIdOption reports length=14: bytes remaining in buffer=44
2016-06-19 23:34:16,481 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=6
2016-06-19 23:34:16,485 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG base.BaseDhcpOption - DhcpV6OptionRequestOption reports length=4: bytes remaining in buffer=26
2016-06-19 23:34:16,485 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=8
2016-06-19 23:34:16,489 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG base.BaseDhcpOption - DhcpV6ElapsedTimeOption reports length=2: bytes remaining in buffer=18
2016-06-19 23:34:16,493 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=3
2016-06-19 23:34:16,493 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG v6.DhcpV6IaNaOption - IA_NA option reports length=12: bytes remaining in buffer=12
2016-06-19 23:34:16,493 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - DhcpMessage decoded.
2016-06-19 23:34:16,500 [pool-3-thread-2] DEBUG netty.DhcpV6ChannelHandler - Received:
Solicit (xactId=2636585) from fe80:0:0:0:2022:22ff:fe22:2222%17:546
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=000100011ef95580222222222222
DhcpV6OptionRequestOption: unsignedShortList=23,24
DhcpV6ElapsedTimeOption: unsignedShort=0
IA_NA_OPTIONS
DhcpV6IaNaOption: iaId=572662306 t1=5400 t2=0
2016-06-19 23:34:16,504 [pool-3-thread-2] INFO request.DhcpV6MessageHandler - Handling client request on local client link address: 0.0.0.0
2016-06-19 23:34:16,530 [pool-3-thread-2] WARN channel.SimpleChannelHandler - EXCEPTION, please implement com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.exceptionCaught() for proper handling.
java.lang.ClassCastException: java.net.Inet4Address cannot be cast to java.net.Inet6Address
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.preProcess(BaseDhcpV6Processor.java:469)
at com.jagornet.dhcp.server.request.DhcpV6SolicitProcessor.preProcess(DhcpV6SolicitProcessor.java:87)
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:412)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:90)
at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.messageReceived(DhcpV6ChannelHandler.java:73)
at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.run(ChannelUpstreamEventRunnable.java:44)
at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Incorrectly checks for port availability on all NIs for IPv4 broadcast

I have many network interfaces on a server machine, and I want to be able to configure Jagornet to act as a DHCP server for a network that is attached to just one of those interfaces. I have configured Jagornet with the --v4bcast parameter to listen on just one network interface. There is already another process using port 67 for another network interface on the server.

The following code shows that Jagornet actually checks that the broadcast port is available on all network interfaces on the host machine, when should it actually just need to check that the port is available on the network interfaces configured for broadcast?

It looks like this could be a simple code change to use a different constructor for DatagramSocket that accepts the IP address as well as the port...
https://docs.oracle.com/javase/7/docs/api/java/net/DatagramSocket.html

[help] v4VendorSpecificOption in config file doesn't work

I need to response suboption in v4VendorSpecificOption to client.
my config xml is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:dhcpServerConfig xmlns:ns2="http://jagornet.com/dhcp/xml">
    <v4ServerIdOption>
        <ipAddress>10.17.0.14</ipAddress>
    </v4ServerIdOption>
    <v6ServerIdOption>
        <opaqueData>
            <hexValue>000100016038A683D60582BAF453</hexValue>
        </opaqueData>
    </v6ServerIdOption>
    <policies>
        <policy>
            <name>dhcp.ignoreLinkLocal</name>
            <value>false</value>
             <name>dhcp.ignoreSelfPackets</name>
            <value>false</value>
        </policy>
    </policies>
    <links>
        <link>
            <name>IPv4 Client Link 1</name>
            <address>10.17.0.0/24</address>
            <policies>
                <policy>
                    <name>v4.defaultLeasetime</name>
                    <value>0</value>
                </policy>
            </policies>
            <v4ConfigOptions>
                <v4SubnetMaskOption>
                    <ipAddress>255.255.255.0</ipAddress>
                </v4SubnetMaskOption>
                <v4RoutersOption>
                    <ipAddress>10.17.0.1</ipAddress>
                </v4RoutersOption>
        <v4VendorSpecificOption>
        <opaqueData>
        <subOptions>
        <optionDef v4="true" code="1" name="VendorSubopt1">
        <stringOption>
        <string>VendorSpecial</string>
       </stringOption>
        </optionDef>
        </subOptions>
        </opaqueData>
        </v4VendorSpecificOption>
            </v4ConfigOptions>
         <v4AddrPools>
                <pool>
                   <range>10.17.0.200-10.17.0.220</range>
                </pool>
          </v4AddrPools>
        </link>
    </links>
</ns2:dhcpServerConfig>

when sever get a request ,log is:
[epollEventLoopGroup-9-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.option.base.BaseOpaqueData.getLength(BaseOpaqueData.java:65) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.core.option.base.BaseOpaqueDataOption.getLength(BaseOpaqueDataOption.java:69) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.core.option.base.BaseDhcpOption.encodeCodeAndLength(BaseDhcpOption.java:66) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.core.option.base.BaseOpaqueDataOption.encode(BaseOpaqueDataOption.java:75) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.server.db.DhcpOption.fromConfigDhcpOption(DhcpOption.java:170) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.binding.BaseBindingManager.convertDhcpOptions(BaseBindingManager.java:1000) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.binding.BaseBindingManager.createBinding(BaseBindingManager.java:399) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.binding.V4AddrBindingManagerImpl.createDiscoverBinding(V4AddrBindingManagerImpl.java:270) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.DhcpV4DiscoverProcessor.process(DhcpV4DiscoverProcessor.java:112) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.BaseDhcpV4Processor.processMessage(BaseDhcpV4Processor.java:221) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.DhcpV4MessageHandler.handleMessage(DhcpV4MessageHandler.java:90) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.netty.DhcpV4ChannelHandler.channelRead0(DhcpV4ChannelHandler.java:77) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.netty.DhcpV4ChannelHandler.channelRead0(DhcpV4ChannelHandler.java:52) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
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.DefaultEventExecutor.run(DefaultEventExecutor.java:66) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.48.Final.jar:4.1.48.Final]
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(Thread.java:748) [?:1.8.0_171]

how to fix it? Thanks!

Server throws ClassCastException when loading IA_PD binding from database

The server fails to load an existing IA_PD binding from the database with a ClassCastException:

2015-09-04 23:22:40,623 [pool-2-thread-3] INFO request.DhcpV6SolicitProcessor - Processing IA_PD Solicit:
DhcpV6IaPdOption: iaId=221572909 t1=0 t2=0
IA_PREFIXES
DhcpV6IaPrefixOption: ipAddress=0:0:0:0:0:0:0:0 prefixLength=56 preferredLifetime=0 validLifetime=0
2015-09-04 23:22:40,742 [pool-2-thread-3] INFO binding.BaseBindingManager - Found current binding for IA: duid=0003000114d64d34ef2d iatype=3(PD) iaid=221572909 state=3
2015-09-04 23:22:40,747 [pool-2-thread-3] ERROR binding.BaseBindingManager - Failed to find current binding
java.lang.ClassCastException: com.jagornet.dhcp.db.IaAddress cannot be cast to com.jagornet.dhcp.db.IaPrefix
at com.jagornet.dhcp.server.request.binding.V6PrefixBindingManagerImpl.buildBindingFromIa(V6PrefixBindingManagerImpl.java:446)
at com.jagornet.dhcp.server.request.binding.BaseBindingManager.findCurrentBinding(BaseBindingManager.java:301)
at com.jagornet.dhcp.server.request.binding.V6PrefixBindingManagerImpl.findCurrentBinding(V6PrefixBindingManagerImpl.java:264)
at com.jagornet.dhcp.server.request.DhcpV6SolicitProcessor.process(DhcpV6SolicitProcessor.java:222)
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:435)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleRelayForward(DhcpV6MessageHandler.java:131)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:81)
at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.messageReceived(DhcpV6ChannelHandler.java:73)
at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:95)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:777)
at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.run(ChannelUpstreamEventRunnable.java:44)
at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Generate test configuration fails with FileNotFoundException

The 'bin/dhcpserver gentestconfig' option fails when saving the output file. The exception is as follows:

2020-11-01 19:12:27,638 [main] INFO com.jagornet.dhcp.server.config.DhcpServerConfiguration - Saving server configuration file: dhcpserver-test-config.xml
java.io.FileNotFoundException: class path resource [dhcpserver-test-config.xml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:150)
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.saveConfig(DhcpServerConfiguration.java:979)
at com.jagornet.dhcp.server.config.GenerateTestConfig.generate(GenerateTestConfig.java:270)
at com.jagornet.dhcp.server.config.GenerateTestConfig.main(GenerateTestConfig.java:288)

Can't allocate IP

If in vlan ,the server can't allocate ip addr.Because the server drop the package that source ip is 0.0.0.0

Minimize DhcpOption class marshalling

The conversion between the com.jagornet.dhcp.core.option.base.DhcpOption and the com.jagornet.dhcp.server.db.DhcpOption classes should be isolated to the persistence layer to minimize data copy operations.

Roadmap features

Do you have a roadmap feature list that your planning to implement?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.