@@ -66,13 +66,16 @@ static const char *s_ca_cert =
66
66
67
67
static int s_num_tests = 0 ;
68
68
69
+ #define ABORT () \
70
+ usleep(500000); /* 500 ms, GH print reason */ \
71
+ abort ();
72
+
69
73
#define ASSERT (expr ) \
70
74
do { \
71
75
s_num_tests++; \
72
76
if (!(expr)) { \
73
77
printf("FAILURE %s:%d: %s\n", __FILE__, __LINE__, #expr); \
74
- usleep(500000); /* 500 ms, GH print reason */ \
75
- abort (); \
78
+ ABORT(); \
76
79
} \
77
80
} while (0)
78
81
@@ -317,18 +320,19 @@ int main(void) {
317
320
ifr .ifr_flags = IFF_TAP | IFF_NO_PI ;
318
321
if (ioctl (fd , TUNSETIFF , (void * ) & ifr ) < 0 ) {
319
322
MG_ERROR (("Failed to setup TAP interface: %s" , ifr .ifr_name ));
320
- abort (); // return EXIT_FAILURE;
323
+ ABORT (); // return EXIT_FAILURE;
321
324
}
322
325
#else
323
326
ifr .ifr_flags = (short ) (IFF_UP | IFF_BROADCAST | IFF_MULTICAST );
324
327
if (ioctl (fd , TUNSIFMODE , (void * ) & ifr ) < 0 ) {
325
328
MG_ERROR (("Failed to setup TAP interface: %s" , ifr .ifr_name ));
326
- abort (); // return EXIT_FAILURE;
329
+ ABORT (); // return EXIT_FAILURE;
327
330
}
328
331
#endif
329
332
fcntl (fd , F_SETFL , fcntl (fd , F_GETFL , 0 ) | O_NONBLOCK ); // Non-blocking mode
330
333
331
334
MG_INFO (("Opened TAP interface: %s" , iface ));
335
+ usleep (200000 ); // 200 ms
332
336
333
337
// Events
334
338
struct mg_mgr mgr ; // Event manager
@@ -361,6 +365,7 @@ int main(void) {
361
365
362
366
mg_tcpip_init (& mgr , & mif );
363
367
MG_INFO (("Init done, starting main loop" ));
368
+ usleep (200000 ); // 200 ms
364
369
365
370
// Stack initialization, Network configuration (DHCP lease, ...)
366
371
#if MIPTAPTEST_USING_DHCP == 0
0 commit comments