mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
Merge pull request #321 from esrf-bliss/slsdetectorserver-max-udp-destination
slsDetectorServer: fix checks on UDP destination entry range
This commit is contained in:
commit
3cfdc063fc
@ -8966,12 +8966,12 @@ int get_dest_udp_list(int file_des) {
|
|||||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
if (arg > MAX_UDP_DESTINATION) {
|
if (arg >= MAX_UDP_DESTINATION) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(
|
sprintf(
|
||||||
mess,
|
mess,
|
||||||
"Could not set udp destination. Invalid entry. Options: 0 - %d\n",
|
"Could not set udp destination. Invalid entry. Options: 0 - %d\n",
|
||||||
MAX_UDP_DESTINATION);
|
MAX_UDP_DESTINATION - 1);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
retvals[0] = arg;
|
retvals[0] = arg;
|
||||||
@ -9041,12 +9041,12 @@ int set_dest_udp_list(int file_des) {
|
|||||||
"mac %s, mac2 %s]\n",
|
"mac %s, mac2 %s]\n",
|
||||||
entry, args[1], args[2], ip, ip2, mac, mac2));
|
entry, args[1], args[2], ip, ip2, mac, mac2));
|
||||||
|
|
||||||
if (entry < 1 || entry > MAX_UDP_DESTINATION) {
|
if (entry < 1 || entry >= MAX_UDP_DESTINATION) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(
|
sprintf(
|
||||||
mess,
|
mess,
|
||||||
"Could not set udp destination. Invalid entry. Options: 1 - %d\n",
|
"Could not set udp destination. Invalid entry. Options: 1 - %d\n",
|
||||||
MAX_UDP_DESTINATION);
|
MAX_UDP_DESTINATION - 1);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
#ifdef EIGERD
|
#ifdef EIGERD
|
||||||
@ -9117,7 +9117,7 @@ int set_dest_udp_list(int file_des) {
|
|||||||
}
|
}
|
||||||
// find number of destinations
|
// find number of destinations
|
||||||
int numdest = 0;
|
int numdest = 0;
|
||||||
for (int i = MAX_UDP_DESTINATION; i >= 0; --i) {
|
for (int i = MAX_UDP_DESTINATION - 1; i >= 0; --i) {
|
||||||
if (udpDetails[i].dstip != 0) {
|
if (udpDetails[i].dstip != 0) {
|
||||||
numdest = i + 1;
|
numdest = i + 1;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user