Bug #30
Updated by Vincenzo Cimino 5 months ago
Trying to send an asyncClMsg to upper layer causes seg fault. Example:
``` cpp
ClMsgOverhearing *m = new ClMsgOverhearing();
m->setIPSource(iph->saddr());
sendAsyncClMsgUp(m);
```
Inside `sendAsyncClMsgUp(m)` (in module.cc) this line executes
``` cpp
sap->sendUp(m->copy(), delay);
```
which in turn run this macro: (in sap.cc)
``` cpp
RUN_DEPRECATED_OR_NEW_VIRTUAL_METHOD(upModule_->crLayCommand(m), upModule_->recvAsyncClMsg(m));
```
which essentially will call the `crLayCommand(m)` method of plugIn class (plugin.cc) that does just this:
``` cpp
delete m;
return RETVAL_NOT_IMPLEMENTED;
```
That is: deletes the cross layer message and return.
Commenting the message deletion seems to solve the problem but it requires further investigating due to the presence of lots of deprecated methods.
Anyways the message has to be deleted on the `recvAsyncClMsg` of the module receiving the message.
Also when using `sendAsyncClMsgUp`, the message is never received by `recvAsyncClMsg` even though the receiving module is a layer above, while using `sendAsyncClMsg` works just fine.