Add ff_ipc_exit() to clean temp files in /var/ while run F-Stack tools arp/ifconfig/route/ipfw.

dev
zjwsoft 2020-06-18 10:56:20 +00:00 committed by root
parent c27efec2cd
commit e10b9b93a8
6 changed files with 53 additions and 2 deletions

View File

@ -230,6 +230,10 @@ main(int argc, char *argv[])
if (ifnameindex != NULL)
if_freenameindex(ifnameindex);
#ifdef FSTACK
ff_ipc_exit();
#endif
return (rtn);
}
@ -735,6 +739,9 @@ usage(void)
" arp -p <f-stack proc_id> -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
" arp -p <f-stack proc_id> -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
" arp -p <f-stack proc_id> -f filename");
#endif
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(1);
}

View File

@ -13,7 +13,7 @@ ifneq (${MK_INET6_SUPPORT},"no")
CFLAGS+= -DINET6
endif
DPDK_CFLAGS= -g -Wall -Werror -include ${FF_DPDK}/include/rte_config.h
DPDK_CFLAGS= -g -Wall -Werror -Wno-deprecated-declarations -include ${FF_DPDK}/include/rte_config.h
DPDK_CFLAGS+= -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
DPDK_CFLAGS+= -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
DPDK_CFLAGS+= -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2

View File

@ -80,6 +80,13 @@ ff_ipc_init(void)
return 0;
}
void
ff_ipc_exit(void)
{
rte_eal_cleanup();
return;
}
struct ff_msg *
ff_ipc_msg_alloc(void)
{

View File

@ -33,6 +33,7 @@
void ff_set_proc_id(int pid);
int ff_ipc_init(void);
void ff_ipc_exit(void);
struct ff_msg *ff_ipc_msg_alloc(void);
int ff_ipc_msg_free(struct ff_msg *msg);

View File

@ -212,6 +212,10 @@ usage(void)
" ifconfig -p <f-stack proc_id> %s[-d] [-m] [-u] [-v]\n",
#endif
options, options, options);
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(1);
}
@ -555,6 +559,9 @@ main(int argc, char *argv[])
errx(1, "%s: cloning name too long",
ifname);
ifconfig(argc, argv, 1, NULL);
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(0);
}
#ifdef JAIL
@ -569,6 +576,9 @@ main(int argc, char *argv[])
errx(1, "%s: interface name too long",
ifname);
ifconfig(argc, argv, 0, NULL);
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(0);
}
#endif
@ -667,6 +677,10 @@ main(int argc, char *argv[])
freeifaddrs(ifap);
freeformat();
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(0);
}
@ -1103,6 +1117,9 @@ setifflags(const char *vname, int value, int s, const struct afswtch *afp)
if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&my_ifr) < 0) {
Perror("ioctl (SIOCGIFFLAGS)");
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(1);
}
flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16);
@ -1125,6 +1142,9 @@ setifcap(const char *vname, int value, int s, const struct afswtch *afp)
if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) < 0) {
Perror("ioctl (SIOCGIFCAP)");
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(1);
}
flags = ifr.ifr_curcap;

View File

@ -281,10 +281,16 @@ main(int argc, char **argv)
case K_FLUSH:
flushroutes(argc, argv);
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(0);
/* NOTREACHED */
}
usage(*argv);
#ifdef FSTACK
ff_ipc_exit();
#endif
/* NOTREACHED */
}
@ -1072,8 +1078,12 @@ newroute(int argc, char **argv)
fl->fl_errno = errno;
error += fl->fl_error;
}
if (*cmd == 'g' || *cmd == 's')
if (*cmd == 'g' || *cmd == 's'){
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(error);
}
error = 0;
if (!qflag) {
@ -1147,6 +1157,9 @@ newroute(int argc, char **argv)
}
}
}
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(error);
}
@ -1553,6 +1566,9 @@ monitor(int argc, char *argv[])
verbose = 1;
if (debugonly) {
interfaces();
#ifdef FSTACK
ff_ipc_exit();
#endif
exit(0);
}
for (;;) {