SwitchEV / RISE-V2G

The only fully-featured reference implementation of the Vehicle-2-Grid communication interface ISO 15118
MIT License
220 stars 92 forks source link

Invalid UDP packet leads to UDP server crash. #89

Open JacobHsieh opened 2 years ago

JacobHsieh commented 2 years ago

RISE-V2G works fine in serving multiple EVCCs with just a single SECC instance.

But when I was trying to send an invalid UDP packet directly to SECC port 15118 with no data,

1.) if the SECC has not served any EVCC (maybe just activated), the invalid UDP packet will be correctly filtered as a false request (MessageHandler.isV2GTPMessageValid()).

image

2.) if the SECC has already served an EVCC, the invalid UDP packet will be incorrectly treated as a valid one. The UDP server will crash, and of course, the SECC cannot serve any new coming EVCC without re-activated.

image

I found out that in UDPServer.run(), the byte[] kind udpClientRequest is not being reset. I wonder whether others meet the sample problem, and the code should reset udpClientRequest every time receiving a new coming UDP packet.

image