signal(SIGTERM, sig_handler);
/* main loop */
- int rc;
+ int rc = 0;
int seqrx = -1;
int seqtx = -1;
while (!stop) {
- rc = 2;
fd_set readset;
int max_fd = 0;
if (-1 == select (max_fd + 1, &readset, NULL, NULL, NULL)) {
if (!stop) {
VERBOSE (ulvpn, ERROR, PRINTF ("select error\n"));
+ rc = 2;
}
break;
}
uint8_t msgtype = -1;
int rxlen = 0;
seqrx = MOREP_Receive (rxblack_fd, &msgtype, buffer, &rxlen);
+ if (seqrx == -2) {
+ continue;
+ }
if (rxlen <= 0) {
VERBOSE (ulvpn, WARNING, PRINTF ("error when receiving from CM black\n"));
uint8_t msgtype = -1;
int rxlen = 0;
seqrx = MOREP_Receive (rxred_fd, &msgtype, buffer, &rxlen);
+ if (seqrx == -2) {
+ continue;
+ }
if (rxlen <= 0) {
VERBOSE (ulvpn, WARNING, PRINTF ("error when receiving from CM bred\n"));
}
- rc = 0;
}
/* cleaning */