diff options
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h | 15 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.lib/in.ndpd/main.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.lib/in.ndpd/ndp.c | 16 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.lib/in.ndpd/tables.h | 2 | ||||
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c | 7 |
5 files changed, 25 insertions, 23 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h index b3cd02cece..b0b0f0f998 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/defs.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -64,6 +63,8 @@ #include <netinet/icmp6.h> #include <net/route.h> +#include "tables.h" + #ifdef __cplusplus extern "C" { #endif @@ -130,8 +131,10 @@ extern struct sockaddr_dl *rta_ifp; #define MAXARGSPERLINE 128 void timer_schedule(uint_t delay); -extern void logmsg(int level, char *fmt, ...); -extern void logperror(char *str); +extern void logmsg(int level, const char *fmt, ...); +extern void logperror(const char *str); +extern void logperror_pi(const struct phyint *pi, const char *str); +extern void logperror_pr(const struct prefix *pr, const char *str); extern int parse_config(char *config_file, boolean_t file_required); extern int poll_add(int fd); diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/main.c b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/main.c index 64faf42330..2ee75f5751 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/main.c +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/main.c @@ -1965,7 +1965,7 @@ fprintdate(FILE *file) /* PRINTFLIKE1 */ void -logmsg(int level, char *fmt, ...) +logmsg(int level, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -1980,7 +1980,7 @@ logmsg(int level, char *fmt, ...) } void -logperror(char *str) +logperror(const char *str) { if (logging) { syslog(LOG_ERR, "%s: %m\n", str); @@ -1991,7 +1991,7 @@ logperror(char *str) } void -logperror_pi(struct phyint *pi, char *str) +logperror_pi(const struct phyint *pi, const char *str) { if (logging) { syslog(LOG_ERR, "%s (interface %s): %m\n", @@ -2004,7 +2004,7 @@ logperror_pi(struct phyint *pi, char *str) } void -logperror_pr(struct prefix *pr, char *str) +logperror_pr(const struct prefix *pr, const char *str) { if (logging) { syslog(LOG_ERR, "%s (prefix %s if %s): %m\n", diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/ndp.c b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/ndp.c index 4220e608b1..61b60d776b 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/ndp.c +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/ndp.c @@ -65,7 +65,7 @@ static void verify_prefix_opt(struct phyint *pi, uchar_t *opt, static void verify_mtu_opt(struct phyint *pi, uchar_t *opt, char *frombuf); -static void update_ra_flag(struct phyint *pi, +static void update_ra_flag(const struct phyint *pi, const struct sockaddr_in6 *from, int isrouter); static uint_t ra_flags; /* Global to detect when to trigger DHCP */ @@ -445,7 +445,7 @@ incoming_ra(struct phyint *pi, struct nd_router_advert *ra, int len, opt = (struct nd_opt_hdr *)((char *)opt + optlen); len -= optlen; } - if (!slla_opt_present) + if (!loopback && !slla_opt_present) update_ra_flag(pi, from, NDF_ISROUTER_ON); /* Stop sending solicitations */ check_to_solicit(pi, SOLICIT_DONE); @@ -1364,7 +1364,8 @@ verify_opt_len(struct nd_opt_hdr *opt, int optlen, * Update IsRouter Flag for Host turning into a router or vice-versa. */ static void -update_ra_flag(struct phyint *pi, const struct sockaddr_in6 *from, int isrouter) +update_ra_flag(const struct phyint *pi, const struct sockaddr_in6 *from, + int isrouter) { struct lifreq lifr; char abuf[INET6_ADDRSTRLEN]; @@ -1386,7 +1387,14 @@ update_ra_flag(struct phyint *pi, const struct sockaddr_in6 *from, int isrouter) (void) strlcpy(lifr.lifr_name, pi->pi_name, sizeof (lifr.lifr_name)); if (ioctl(pi->pi_sock, SIOCLIFGETND, (char *)&lifr) < 0) { - logperror_pi(pi, "update_ra_flag: SIOCLIFGETND"); + if (errno == ESRCH) { + if (debug & D_IFSCAN) { + logmsg(LOG_DEBUG, +"update_ra_flag: SIOCLIFGETND: nce doesn't exist, not setting IFF_ROUTER"); + } + } else { + logperror_pi(pi, "update_ra_flag: SIOCLIFGETND"); + } } else { /* * The lif_nd_req structure has three state values to be used diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/tables.h b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/tables.h index cf13dc5c02..20caf691c6 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/tables.h +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/tables.h @@ -323,8 +323,6 @@ extern void router_update_k(struct router *dr); extern uint_t router_timer(struct router *dr, uint_t elapsed); -extern void logperror_pi(struct phyint *pi, char *str); -extern void logperror_pr(struct prefix *pr, char *str); extern void check_to_advertise(struct phyint *pi, enum adv_events event); extern void check_to_solicit(struct phyint *pi, enum solicit_events event); diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c b/usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c index 7a34e9d0a7..ce6f44fd71 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ping/ping.c @@ -1471,13 +1471,6 @@ setup_socket(int family, int *send_sockp, int *recv_sockp, int *if_index, progname, strerror(errno)); exit(EXIT_FAILURE); } - if (setsockopt(recv_sock, IPPROTO_IPV6, IPV6_RECVRTHDRDSTOPTS, - (char *)&on, sizeof (on)) == -1) { - Fprintf(stderr, - "%s: setsockopt IPV6_RECVRTHDRDSTOPTS %s\n", - progname, strerror(errno)); - exit(EXIT_FAILURE); - } } *send_sockp = send_sock; |