diff options
author | Matt Smith <mgsmith@netgate.com> | 2015-11-18 10:33:09 -0600 |
---|---|---|
committer | Matt Smith <mgsmith@netgate.com> | 2015-11-18 10:33:09 -0600 |
commit | 49b146ba33ce96cb15eb34e14292aeceb43e422c (patch) | |
tree | 1d137b4c183c48412ac1e3c7220c1a8cd737eab5 | |
parent | 8aa932909d60eadad51eeab403c8993d8fb888d1 (diff) | |
download | FreeBSD-src-49b146ba33ce96cb15eb34e14292aeceb43e422c.zip FreeBSD-src-49b146ba33ce96cb15eb34e14292aeceb43e422c.tar.gz |
Importing pfSense patch redmine_4246.diff
-rw-r--r-- | usr.bin/netstat/mroute.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c index 3766415..3ec716d 100644 --- a/usr.bin/netstat/mroute.c +++ b/usr.bin/netstat/mroute.c @@ -236,16 +236,7 @@ mroutepr() * functionality was deprecated, as PIM does not use it. */ maxvif = 0; - - kresolve_list(mrl); - pmfchashtbl = mrl[N_MFCHASHTBL].n_value; - pmfctablesize = mrl[N_MFCTABLESIZE].n_value; - pviftbl = mrl[N_VIFTABLE].n_value; - - if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { - fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); - return; - } + pmfchashtbl = pmfctablesize = pviftbl = 0; len = sizeof(viftable); if (live) { @@ -254,8 +245,19 @@ mroutepr() warn("sysctl: net.inet.ip.viftable"); return; } - } else + } else { + kresolve_list(mrl); + pmfchashtbl = mrl[N_MFCHASHTBL].n_value; + pmfctablesize = mrl[N_MFCTABLESIZE].n_value; + pviftbl = mrl[N_VIFTABLE].n_value; + + if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } + kread(pviftbl, (char *)viftable, sizeof(viftable)); + } banner_printed = 0; for (vifi = 0, v = viftable; vifi < MAXVIFS; ++vifi, ++v) { |