On di, 16 jul 2019 06:36:35 +0200, Oleksij Rempel wrote: > Hi Arthur, > > On 15.07.19 16:15, Arthur Guyader wrote: > >Hello, > > > >I encountered a problem when using the claiming address. > >When an ECU1 with a low name requests an address, it is saved in the kernel cache. > >If this ECU1 is cut, and we launch our ECU2 which will ask for the same address. > >He will have no answer from ECU1 and has no trace of him in his cache, so > >he can consider that the address is free. > >However, the kernel will consider that the address is busy and generate an > >error when sending a message. (99 : cannot assign requested address) > > > >How would you handle this situation? AFAIK, J1939 does not describe a timeout on claimed addresses, so technically, ECU1 is never really away. The code will respect the j1939 spec, and will never timeout either on that. > > You are describing a broken system. Is it a theoretical question or you was > able to reproduce it with latest j1939 stack? > > >I thought about sending a test message and handling the error case and > >choosing another address. Rather than sending a 'test message', you try to claim the address and see if it works. I realize (just looked into the code) and saw that jacd does not use the errno=99 case when sending the address claim. If it did, it could just choose the next address in line. > > > >Is there any way to clear the kernel cache? > > No. You can send an address claim message with idle address. The answer is yes, you can send an address claim with idle address :-) This is hardly legal in j1939 terms to send the address claim on another nodes behalf, but it would work. Kurt