|
|
@ -121,7 +121,7 @@ SVReceiver_disableDestAddrCheck(SVReceiver self)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
SVReceiver_enableDestAddrCheck(SVReceiver self)
|
|
|
|
SVReceiver_enableDestAddrCheck(SVReceiver self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
self->checkDestAddr = false;
|
|
|
|
self->checkDestAddr = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -446,7 +446,7 @@ parseSVMessage(SVReceiver self, int numbytes)
|
|
|
|
if (numbytes < 22) return;
|
|
|
|
if (numbytes < 22) return;
|
|
|
|
|
|
|
|
|
|
|
|
/* Ethernet source address */
|
|
|
|
/* Ethernet source address */
|
|
|
|
uint8_t* srcAddr = buffer;
|
|
|
|
uint8_t* dstAddr = buffer;
|
|
|
|
|
|
|
|
|
|
|
|
/* skip ethernet addresses */
|
|
|
|
/* skip ethernet addresses */
|
|
|
|
bufPos = 12;
|
|
|
|
bufPos = 12;
|
|
|
@ -509,13 +509,13 @@ parseSVMessage(SVReceiver self, int numbytes)
|
|
|
|
if (subscriber->appId == appId) {
|
|
|
|
if (subscriber->appId == appId) {
|
|
|
|
|
|
|
|
|
|
|
|
if (self->checkDestAddr) {
|
|
|
|
if (self->checkDestAddr) {
|
|
|
|
if (memcmp(srcAddr, subscriber->ethAddr, 6) == 0) {
|
|
|
|
if (memcmp(dstAddr, subscriber->ethAddr, 6) == 0) {
|
|
|
|
subscriberFound = true;
|
|
|
|
subscriberFound = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (DEBUG_SV_SUBSCRIBER)
|
|
|
|
if (DEBUG_SV_SUBSCRIBER)
|
|
|
|
printf("SV_SUBSCRIBER: Checking ethernet src address failed!\n");
|
|
|
|
printf("SV_SUBSCRIBER: Checking ethernet dest address failed!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
subscriberFound = true;
|
|
|
|
subscriberFound = true;
|
|
|
@ -537,7 +537,7 @@ parseSVMessage(SVReceiver self, int numbytes)
|
|
|
|
parseSVPayload(self, subscriber, buffer + bufPos, apduLength);
|
|
|
|
parseSVPayload(self, subscriber, buffer + bufPos, apduLength);
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (DEBUG_SV_SUBSCRIBER)
|
|
|
|
if (DEBUG_SV_SUBSCRIBER)
|
|
|
|
printf("SV_SUBSCRIBER: SV message ignored due to unknown APPID value\n");
|
|
|
|
printf("SV_SUBSCRIBER: SV message ignored due to unknown APPID value or dest address mismatch\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|