Compare commits
1 Commits
v0.0.27-mu
...
v0.0.28-mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0d5007bfb |
2
mud
2
mud
Submodule mud updated: 11903da862...1b58401095
11
src/main.c
11
src/main.c
@@ -342,6 +342,7 @@ int main (int argc, char **argv)
|
|||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
|
|
||||||
|
int started = 0;
|
||||||
unsigned char buf[2048];
|
unsigned char buf[2048];
|
||||||
|
|
||||||
while (!gt.quit) {
|
while (!gt.quit) {
|
||||||
@@ -364,6 +365,16 @@ int main (int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mud_is_up(mud)) {
|
||||||
|
if (!started) {
|
||||||
|
state("STARTED", NULL);
|
||||||
|
started = 1;
|
||||||
|
}
|
||||||
|
} else if (started) {
|
||||||
|
state("STOPPED", NULL);
|
||||||
|
started = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (FD_ISSET(tun_fd, &rfds)) {
|
if (FD_ISSET(tun_fd, &rfds)) {
|
||||||
while (1) {
|
while (1) {
|
||||||
const ssize_t r = tun_read(tun_fd, buf, sizeof(buf));
|
const ssize_t r = tun_read(tun_fd, buf, sizeof(buf));
|
||||||
|
|||||||
Reference in New Issue
Block a user