netstat: Initialize more global variables

This commit is contained in:
Sebastian Huber
2014-09-18 13:01:54 +02:00
parent 705d1bf8d2
commit a29a71b7ca
3 changed files with 15 additions and 0 deletions

View File

@@ -89,6 +89,15 @@ void inetprint(struct in_addr *, int, const char *, int);
#ifdef INET6
static int udp_done, tcp_done, sdp_done;
#endif /* INET6 */
#ifdef __rtems__
void
rtems_bsd_netstat_inet_init(void)
{
udp_done = 0;
tcp_done = 0;
sdp_done = 0;
}
#endif /* __rtems__ */
static int
pcblist_sysctl(int proto, const char *name, char **bufp, int istcp)

View File

@@ -389,6 +389,7 @@ int rtems_bsd_command_netstat(int argc, char *argv[])
Aflag = 0;
aflag = 0;
Bflag = 0;
bflag = 0;
dflag = 0;
gflag = 0;
@@ -414,6 +415,8 @@ int rtems_bsd_command_netstat(int argc, char *argv[])
protopr_initialized = 0;
do_rtent = 0;
rtems_bsd_netstat_inet_init();
exit_code = rtems_bsd_program_call_main("netstat", main, argc, argv);
free(rt_tables);

View File

@@ -178,3 +178,6 @@ void tp_stats(caddr_t, caddr_t);
void mroutepr(u_long, u_long, u_long);
void mrt_stats(u_long);
void bpf_stats(char *);
#ifdef __rtems__
void rtems_bsd_netstat_inet_init(void);
#endif /* __rtems__ */