From 318405ae4f272fe2fb5f051788fcd7b8d06dac7e Mon Sep 17 00:00:00 2001 From: fgiunchedi Date: Wed, 6 Feb 2008 11:28:09 +0000 Subject: [PATCH] solve some more warnings git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@231 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde-2/vdetaplib/Makefile.am | 2 ++ vde-2/vdetaplib/libvdetap.c | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/vde-2/vdetaplib/Makefile.am b/vde-2/vdetaplib/Makefile.am index cc7282b..8fc263c 100644 --- a/vde-2/vdetaplib/Makefile.am +++ b/vde-2/vdetaplib/Makefile.am @@ -3,6 +3,8 @@ libexec_PROGRAMS = vdetap libvdetap_la_SOURCES = libvdetap.c libvdetap_la_LDFLAGS = -avoid-version -export-dynamic -module -Wl,-init -Wl,libvdetap_init -Wl,-fini -Wl,libvdetap_fini +# vdetaplib/libvdetap.c|85| warning: dereferencing type-punned pointer will break strict-aliasing rules +libvdetap_la_CFLAGS = -fno-strict-aliasing AM_CPPFLAGS=-DLIBEXECDIR=\"$(libexecdir)\" diff --git a/vde-2/vdetaplib/libvdetap.c b/vde-2/vdetaplib/libvdetap.c index dc61cc3..1d76934 100644 --- a/vde-2/vdetaplib/libvdetap.c +++ b/vde-2/vdetaplib/libvdetap.c @@ -58,10 +58,12 @@ static struct pidlist *plmalloc(void) { return rv; } +/* not used? static void plfree (struct pidlist *el) { el->next=flh; flh=el; } +*/ static int addpid(int pid) { struct pidlist *plp; @@ -168,15 +170,17 @@ int ioctl(int fd, unsigned long int command, ...) sprintf(name,ifr->ifr_name,tapcount++); strncpy(ifr->ifr_name,name,IFNAMSIZ); } - if (ifr->ifr_flags & IFF_TAP && - ((vdesock=getenv(ifr->ifr_name)) != NULL) - ||(vdesock=getenv(VDEALLTAP)) != NULL){ + if ((ifr->ifr_flags & IFF_TAP) && ( + /* from env: single interface or VDEALLTAP */ + ((vdesock=getenv(ifr->ifr_name)) != NULL) || + (vdesock=getenv(VDEALLTAP)) != NULL) + ){ if ((pid=fork()) < 0) { close(tapfd[1]); errno=EINVAL; return -1; } else if (pid > 0) { /*father*/ - if(pid=addpid(pid) < 0) { + if((pid=addpid(pid)) < 0) { close(tapfd[0]); close(tapfd[1]); return -1; @@ -188,7 +192,7 @@ int ioctl(int fd, unsigned long int command, ...) plh=NULL; close(tapfd[0]); sprintf(num,"%d",tapfd[1]); - execlp(VDETAPEXEC,"-",num,vdesock,name,(char *) 0); + return execlp(VDETAPEXEC,"-",num,vdesock,name,(char *) 0); } } else /*roll back to the native tuntap*/ @@ -216,9 +220,9 @@ int ioctl(int fd, unsigned long int command, ...) } } } - } else + } else return 0; - } else + } else return (native_ioctl(fd, command, data)); } -- 2.11.4.GIT