Print this page
OS-4807 arp(1M) and ndp(1M) should use zone_get_nroot()

*** 38,47 **** --- 38,48 ---- #include <netinet/in.h> #include <arpa/inet.h> #include <inet/ip.h> #include <net/if_dl.h> #include <net/route.h> + #include <zone.h> typedef struct sockaddr_in6 sin6_t; #define BUF_SIZE 2048 typedef struct rtmsg_pkt {
*** 93,110 **** static int ndp_set(int, struct lifreq *, void *); static int ndp_set_nce(char *, char *, char *[], int); static int ndp_set_file(char *); static char *ndp_iface = NULL; - static char *netstat_path = "/usr/bin/netstat"; static pid_t ndp_pid; static boolean_t ndp_noresolve = B_FALSE; /* Don't lookup addresses */ static boolean_t ndp_run = B_TRUE; #define MAX_ATTEMPTS 5 #define MAX_OPTS 5 #define WORDSEPS " \t\r\n" /* * Macros borrowed from route(1M) for working with PF_ROUTE messages */ #define RT_ADVANCE(x, n) ((x) += ndp_salen(n)) --- 94,111 ---- static int ndp_set(int, struct lifreq *, void *); static int ndp_set_nce(char *, char *, char *[], int); static int ndp_set_file(char *); static char *ndp_iface = NULL; static pid_t ndp_pid; static boolean_t ndp_noresolve = B_FALSE; /* Don't lookup addresses */ static boolean_t ndp_run = B_TRUE; #define MAX_ATTEMPTS 5 #define MAX_OPTS 5 #define WORDSEPS " \t\r\n" + #define NETSTAT_PATH "/usr/bin/netstat" /* * Macros borrowed from route(1M) for working with PF_ROUTE messages */ #define RT_ADVANCE(x, n) ((x) += ndp_salen(n))
*** 765,774 **** --- 766,781 ---- * Print out all NDP entries */ static void ndp_get_all(void) { + char netstat_path[MAXPATHLEN]; + const char *zroot = zone_get_nroot(); + + (void) snprintf(netstat_path, sizeof (netstat_path), "%s%s", zroot != NULL ? + zroot : "", NETSTAT_PATH); + (void) execl(netstat_path, "netstat", (ndp_noresolve ? "-np" : "-p"), "-f", "inet6", (char *)0); ndp_fatal("Coudn't exec %s: %s", netstat_path, strerror(errno)); }