svn commit: r249049 - in stable/9: etc/rc.d usr.sbin/rtadvd

Dag-Erling Smørgrav des at FreeBSD.org
Wed Apr 3 11:51:12 UTC 2013


Author: des
Date: Wed Apr  3 11:51:11 2013
New Revision: 249049
URL: http://svnweb.freebsd.org/changeset/base/249049

Log:
  MFH (r247270, r247271): allow starting rtadvd without any interfaces.

Modified:
  stable/9/etc/rc.d/rtadvd
  stable/9/usr.sbin/rtadvd/rtadvd.8
  stable/9/usr.sbin/rtadvd/rtadvd.c
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/usr.sbin/rtadvd/   (props changed)

Modified: stable/9/etc/rc.d/rtadvd
==============================================================================
--- stable/9/etc/rc.d/rtadvd	Wed Apr  3 11:30:18 2013	(r249048)
+++ stable/9/etc/rc.d/rtadvd	Wed Apr  3 11:51:11 2013	(r249049)
@@ -45,6 +45,9 @@ rtadvd_precmd()
 			fi
 		done
 		;;
+	[Nn][Oo][Nn][Ee])
+		rtadvd_interfaces=""
+		;;
 	esac
 	command_args="${rtadvd_interfaces}"
 

Modified: stable/9/usr.sbin/rtadvd/rtadvd.8
==============================================================================
--- stable/9/usr.sbin/rtadvd/rtadvd.8	Wed Apr  3 11:30:18 2013	(r249048)
+++ stable/9/usr.sbin/rtadvd/rtadvd.8	Wed Apr  3 11:51:11 2013	(r249049)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 14, 2011
+.Dd February 25, 2013
 .Dt RTADVD 8
 .Os
 .Sh NAME
@@ -39,13 +39,19 @@
 .Nm
 .Op Fl dDfRs
 .Op Fl c Ar configfile
+.Op Fl C Ar ctlsock
 .Op Fl M Ar ifname
 .Op Fl p Ar pidfile
-.Ar interface ...
+.Op Ar interface ...
 .Sh DESCRIPTION
 .Nm
 sends router advertisement packets to the specified
 .Ar interfaces .
+If no interfaces are specified,
+.Nm
+will still run, but will not advertise any routes until interfaces are
+added using
+.Xr rtadvctl 8 .
 .Pp
 The program will daemonize itself on invocation.
 It will then send router advertisement packets periodically, as well
@@ -121,6 +127,11 @@ for the configuration file.
 By default,
 .Pa /etc/rtadvd.conf
 is used.
+.It Fl C
+Specify an alternate location for the control socket used by
+.Xr rtadvctl 8 .
+The default is
+.Pa /var/run/rtadvd.sock .
 .It Fl d
 Print debugging information.
 .It Fl D
@@ -185,6 +196,7 @@ The default process ID file.
 .Ex -std
 .Sh SEE ALSO
 .Xr rtadvd.conf 5 ,
+.Xr rtadvctl 8 ,
 .Xr rtsol 8
 .Rs
 .%A Thomas Narten

Modified: stable/9/usr.sbin/rtadvd/rtadvd.c
==============================================================================
--- stable/9/usr.sbin/rtadvd/rtadvd.c	Wed Apr  3 11:30:18 2013	(r249048)
+++ stable/9/usr.sbin/rtadvd/rtadvd.c	Wed Apr  3 11:51:11 2013	(r249049)
@@ -166,6 +166,15 @@ static void	rtmsg_input(struct sockinfo 
 static void	set_short_delay(struct ifinfo *);
 static int	check_accept_rtadv(int);
 
+static void
+usage(void)
+{
+
+	fprintf(stderr, "usage: rtadvd [-dDfRs] "
+	    "[-c configfile] [-C ctlsock] [-M ifname] [-p pidfile]\n");
+	exit(1);
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -177,7 +186,7 @@ main(int argc, char *argv[])
 	pid_t pid, otherpid;
 
 	/* get command line options and arguments */
-	while ((ch = getopt(argc, argv, "c:C:dDfM:p:Rs")) != -1) {
+	while ((ch = getopt(argc, argv, "c:C:dDfhM:p:Rs")) != -1) {
 		switch (ch) {
 		case 'c':
 			conffile = optarg;
@@ -209,17 +218,12 @@ main(int argc, char *argv[])
 		case 'p':
 			pidfilename = optarg;
 			break;
+		default:
+			usage();
 		}
 	}
 	argc -= optind;
 	argv += optind;
-	if (argc == 0) {
-		fprintf(stderr,
-		    "usage: rtadvd [-dDfRs] [-c conffile] "
-		    "[-C ctrlsockname] [-M ifname] "
-		    "[-p pidfile] interfaces...\n");
-		exit(1);
-	}
 
 	logopt = LOG_NDELAY | LOG_PID;
 	if (fflag)


More information about the svn-src-stable-9 mailing list