mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Fix compiler warnings
This commit is contained in:
parent
06dfce6d46
commit
4cab313b8c
@ -43,6 +43,7 @@
|
|||||||
#include "net/packetbuf.h"
|
#include "net/packetbuf.h"
|
||||||
#include "net/netstack.h"
|
#include "net/netstack.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -93,8 +93,11 @@ static void
|
|||||||
remove_route(void)
|
remove_route(void)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
int ret;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "route delete -net 172.18.0.0");
|
snprintf(buf, sizeof(buf), "route delete -net 172.18.0.0");
|
||||||
system(buf);
|
ret = system(buf);
|
||||||
|
fprintf(stderr, "ret %d\n", ret);
|
||||||
fprintf(stderr, "%s\n", buf);
|
fprintf(stderr, "%s\n", buf);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -103,6 +106,7 @@ void
|
|||||||
tapdev_init(void)
|
tapdev_init(void)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
int ret;
|
||||||
|
|
||||||
fd = open(DEVTAP, O_RDWR);
|
fd = open(DEVTAP, O_RDWR);
|
||||||
if(fd == -1) {
|
if(fd == -1) {
|
||||||
@ -123,7 +127,8 @@ tapdev_init(void)
|
|||||||
#endif /* Linux */
|
#endif /* Linux */
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "ifconfig tap0 inet 172.18.0.1/16");
|
snprintf(buf, sizeof(buf), "ifconfig tap0 inet 172.18.0.1/16");
|
||||||
system(buf);
|
ret = system(buf);
|
||||||
|
fprintf(stderr, "ret %d\n", ret);
|
||||||
fprintf(stderr, "%s\n", buf);
|
fprintf(stderr, "%s\n", buf);
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
/* route add for linux */
|
/* route add for linux */
|
||||||
@ -133,7 +138,8 @@ tapdev_init(void)
|
|||||||
snprintf(buf, sizeof(buf), "route add -net 172.18.0.0/16 -iface tap0");
|
snprintf(buf, sizeof(buf), "route add -net 172.18.0.0/16 -iface tap0");
|
||||||
#endif /* linux */
|
#endif /* linux */
|
||||||
|
|
||||||
system(buf);
|
ret = system(buf);
|
||||||
|
fprintf(stderr, "ret %d\n", ret);
|
||||||
fprintf(stderr, "%s\n", buf);
|
fprintf(stderr, "%s\n", buf);
|
||||||
atexit(remove_route);
|
atexit(remove_route);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user