summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-08-08 20:14:28 +0000
committerume <ume@FreeBSD.org>2003-08-08 20:14:28 +0000
commit59b29c0142078eeb87efb3ea85716bec33a1806c (patch)
treecdde65bb643bb7f2a719b86659fa4ca7c2f8edad /usr.sbin/rtadvd
parente213f094802cf818efb2d12950d4237484790ea7 (diff)
downloadFreeBSD-src-59b29c0142078eeb87efb3ea85716bec33a1806c.zip
FreeBSD-src-59b29c0142078eeb87efb3ea85716bec33a1806c.tar.gz
Drop MIP6 code. We don't support MIP6 yet.
MFC after: 1 week
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r--usr.sbin/rtadvd/config.c88
-rw-r--r--usr.sbin/rtadvd/dump.c13
-rw-r--r--usr.sbin/rtadvd/rtadvd.c20
-rw-r--r--usr.sbin/rtadvd/rtadvd.h25
4 files changed, 4 insertions, 142 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index e7d9409..b754fd6 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -48,9 +48,6 @@
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet/icmp6.h>
-#ifdef MIP6
-#include <netinet6/mip6.h>
-#endif
#include <arpa/inet.h>
@@ -181,10 +178,6 @@ getconfig(intface)
MAYHAVE(val, "raflags", 0);
tmp->managedflg = val & ND_RA_FLAG_MANAGED;
tmp->otherflg = val & ND_RA_FLAG_OTHER;
-#ifdef MIP6
- if (mobileip6)
- tmp->haflg = val & ND_RA_FLAG_HA;
-#endif
#ifndef ND_RA_FLAG_RTPREF_MASK
#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
@@ -238,39 +231,12 @@ getconfig(intface)
}
tmp->retranstimer = (u_int32_t)val64;
-#ifndef MIP6
if (agetstr("hapref", &bp) || agetstr("hatime", &bp)) {
syslog(LOG_ERR,
"<%s> mobile-ip6 configuration not supported",
__func__);
exit(1);
}
-#else
- if (!mobileip6) {
- if (agetstr("hapref", &bp) || agetstr("hatime", &bp)) {
- syslog(LOG_ERR,
- "<%s> mobile-ip6 configuration without "
- "proper command line option",
- __func__);
- exit(1);
- }
- } else {
- tmp->hapref = 0;
- if ((val = agetnum("hapref")) >= 0)
- tmp->hapref = (int16_t)val;
- if (tmp->hapref != 0) {
- tmp->hatime = 0;
- MUSTHAVE(val, "hatime");
- tmp->hatime = (u_int16_t)val;
- if (tmp->hatime <= 0) {
- syslog(LOG_ERR,
- "<%s> home agent lifetime must be greater than 0",
- __func__);
- exit(1);
- }
- }
- }
-#endif
/* prefix information */
@@ -328,23 +294,12 @@ getconfig(intface)
makeentry(entbuf, sizeof(entbuf), i, "pinfoflags",
added);
-#ifdef MIP6
- if (mobileip6)
- {
- MAYHAVE(val, entbuf,
- (ND_OPT_PI_FLAG_ONLINK|ND_OPT_PI_FLAG_AUTO|
- ND_OPT_PI_FLAG_ROUTER));
- } else
-#endif
{
MAYHAVE(val, entbuf,
(ND_OPT_PI_FLAG_ONLINK|ND_OPT_PI_FLAG_AUTO));
}
pfx->onlinkflg = val & ND_OPT_PI_FLAG_ONLINK;
pfx->autoconfflg = val & ND_OPT_PI_FLAG_AUTO;
-#ifdef MIP6
- pfx->routeraddr = val & ND_OPT_PI_FLAG_ROUTER;
-#endif
makeentry(entbuf, sizeof(entbuf), i, "vltime", added);
MAYHAVE(val64, entbuf, DEF_ADVVALIDLIFETIME);
@@ -871,10 +826,6 @@ make_packet(struct rainfo *rainfo)
struct nd_router_advert *ra;
struct nd_opt_prefix_info *ndopt_pi;
struct nd_opt_mtu *ndopt_mtu;
-#ifdef MIP6
- struct nd_opt_advinterval *ndopt_advint;
- struct nd_opt_homeagent_info *ndopt_hai;
-#endif
struct nd_opt_route_info *ndopt_rti;
struct prefix *pfx;
struct rtinfo *rti;
@@ -895,12 +846,6 @@ make_packet(struct rainfo *rainfo)
packlen += sizeof(struct nd_opt_prefix_info) * rainfo->pfxs;
if (rainfo->linkmtu)
packlen += sizeof(struct nd_opt_mtu);
-#ifdef MIP6
- if (mobileip6 && rainfo->maxinterval)
- packlen += sizeof(struct nd_opt_advinterval);
- if (mobileip6 && rainfo->hatime)
- packlen += sizeof(struct nd_opt_homeagent_info);
-#endif
#ifdef ND_OPT_ROUTE_INFO
for (rti = rainfo->route.next; rti != &rainfo->route; rti = rti->next)
packlen += sizeof(struct nd_opt_route_info) +
@@ -941,10 +886,6 @@ make_packet(struct rainfo *rainfo)
rainfo->managedflg ? ND_RA_FLAG_MANAGED : 0;
ra->nd_ra_flags_reserved |=
rainfo->otherflg ? ND_RA_FLAG_OTHER : 0;
-#ifdef MIP6
- ra->nd_ra_flags_reserved |=
- rainfo->haflg ? ND_RA_FLAG_HA : 0;
-#endif
ra->nd_ra_router_lifetime = htons(rainfo->lifetime);
ra->nd_ra_reachable = htonl(rainfo->reachabletime);
ra->nd_ra_retransmit = htonl(rainfo->retranstimer);
@@ -964,30 +905,6 @@ make_packet(struct rainfo *rainfo)
buf += sizeof(struct nd_opt_mtu);
}
-#ifdef MIP6
- if (mobileip6 && rainfo->maxinterval) {
- ndopt_advint = (struct nd_opt_advinterval *)buf;
- ndopt_advint->nd_opt_adv_type = ND_OPT_ADVINTERVAL;
- ndopt_advint->nd_opt_adv_len = 1;
- ndopt_advint->nd_opt_adv_reserved = 0;
- ndopt_advint->nd_opt_adv_interval = htonl(rainfo->maxinterval *
- 1000);
- buf += sizeof(struct nd_opt_advinterval);
- }
-#endif
-
-#ifdef MIP6
- if (rainfo->hatime) {
- ndopt_hai = (struct nd_opt_homeagent_info *)buf;
- ndopt_hai->nd_opt_hai_type = ND_OPT_HOMEAGENT_INFO;
- ndopt_hai->nd_opt_hai_len = 1;
- ndopt_hai->nd_opt_hai_reserved = 0;
- ndopt_hai->nd_opt_hai_preference = htons(rainfo->hapref);
- ndopt_hai->nd_opt_hai_lifetime = htons(rainfo->hatime);
- buf += sizeof(struct nd_opt_homeagent_info);
- }
-#endif
-
for (pfx = rainfo->prefix.next;
pfx != &rainfo->prefix; pfx = pfx->next) {
u_int32_t vltime, pltime;
@@ -1004,11 +921,6 @@ make_packet(struct rainfo *rainfo)
if (pfx->autoconfflg)
ndopt_pi->nd_opt_pi_flags_reserved |=
ND_OPT_PI_FLAG_AUTO;
-#ifdef MIP6
- if (pfx->routeraddr)
- ndopt_pi->nd_opt_pi_flags_reserved |=
- ND_OPT_PI_FLAG_ROUTER;
-#endif
if (pfx->timer)
vltime = 0;
else {
diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c
index 796ba90..122f31f 100644
--- a/usr.sbin/rtadvd/dump.c
+++ b/usr.sbin/rtadvd/dump.c
@@ -148,21 +148,13 @@ if_dump()
"MinAdvInterval: %d\n", rai->lifetime, rai->maxinterval,
rai->mininterval);
fprintf(fp, " Flags: %s%s%s, ",
- rai->managedflg ? "M" : "", rai->otherflg ? "O" : "",
-#ifdef MIP6
- rai->haflg ? "H" :
-#endif
- "");
+ rai->managedflg ? "M" : "", rai->otherflg ? "O" : "", "");
fprintf(fp, "Preference: %s, ",
rtpref_str[(rai->rtpref >> 3) & 0xff]);
fprintf(fp, "MTU: %d\n", rai->linkmtu);
fprintf(fp, " ReachableTime: %d, RetransTimer: %d, "
"CurHopLimit: %d\n", rai->reachabletime,
rai->retranstimer, rai->hoplimit);
-#ifdef MIP6
- fprintf(fp, " HAPreference: %d, HALifetime: %d\n",
- rai->hapref, rai->hatime);
-#endif
if (rai->clockskew)
fprintf(fp, " Clock skew: %ldsec\n",
@@ -212,9 +204,6 @@ if_dump()
fprintf(fp, "flags: %s%s%s",
pfx->onlinkflg ? "L" : "",
pfx->autoconfflg ? "A" : "",
-#ifdef MIP6
- pfx->routeraddr ? "R" :
-#endif
"");
if (pfx->timer) {
struct timeval *rest;
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 9673962..2d88c8f 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -81,9 +81,6 @@ static char *pidfilename = "/var/run/rtadvd.pid"; /* should be configurable */
static char *mcastif;
int sock;
int rtsock = -1;
-#ifdef MIP6
-int mobileip6 = 0;
-#endif
int accept_rr = 0;
int dflag = 0, sflag = 0;
@@ -159,13 +156,7 @@ main(argc, argv)
openlog("rtadvd", LOG_NDELAY|LOG_PID, LOG_DAEMON);
/* get command line options and arguments */
-#ifdef MIP6
-#define OPTIONS "c:dDfM:mRs"
-#else
-#define OPTIONS "c:dDfM:Rs"
-#endif
- while ((ch = getopt(argc, argv, OPTIONS)) != -1) {
-#undef OPTIONS
+ while ((ch = getopt(argc, argv, "c:dDfM:Rs")) != -1) {
switch (ch) {
case 'c':
conffile = optarg;
@@ -182,11 +173,6 @@ main(argc, argv)
case 'M':
mcastif = optarg;
break;
-#ifdef MIP6
- case 'm':
- mobileip6 = 1;
- break;
-#endif
case 'R':
fprintf(stderr, "rtadvd: "
"the -R option is currently ignored.\n");
@@ -202,11 +188,7 @@ main(argc, argv)
argv += optind;
if (argc == 0) {
fprintf(stderr,
-#ifdef MIP6
- "usage: rtadvd [-dDfMmRs] [-c conffile] "
-#else
"usage: rtadvd [-dDfMRs] [-c conffile] "
-#endif
"interfaces...\n");
exit(1);
}
diff --git a/usr.sbin/rtadvd/rtadvd.h b/usr.sbin/rtadvd/rtadvd.h
index c391249..a25e861 100644
--- a/usr.sbin/rtadvd/rtadvd.h
+++ b/usr.sbin/rtadvd/rtadvd.h
@@ -46,20 +46,12 @@
#define DEF_ADVPREFERREDLIFETIME 604800
/*XXX int-to-double comparison for INTERVAL items */
-#ifndef MIP6
-#define mobileip6 0
-#endif
-
#define MAXROUTERLIFETIME 9000
-#define MIN_MAXINTERVAL (mobileip6 ? 1.5 : 4.0)
+#define MIN_MAXINTERVAL 4.0
#define MAX_MAXINTERVAL 1800
-#define MIN_MININTERVAL (mobileip6 ? 0.5 : 3)
+#define MIN_MININTERVAL 3
#define MAXREACHABLETIME 3600000
-#ifndef MIP6
-#undef miobileip6
-#endif
-
#define MAX_INITIAL_RTR_ADVERT_INTERVAL 16
#define MAX_INITIAL_RTR_ADVERTISEMENTS 3
#define MAX_FINAL_RTR_ADVERTISEMENTS 3
@@ -86,9 +78,6 @@ struct prefix {
long pltimeexpire; /* expiration of pltime; decrement case only */
u_int onlinkflg; /* bool: AdvOnLinkFlag */
u_int autoconfflg; /* bool: AdvAutonomousFlag */
-#ifdef MIP6
- u_int routeraddr; /* bool: RouterAddress */
-#endif
int prefixlen;
int origin; /* from kernel or config */
struct in6_addr prefix;
@@ -132,9 +121,6 @@ struct rainfo {
u_int mininterval; /* MinRtrAdvInterval */
int managedflg; /* AdvManagedFlag */
int otherflg; /* AdvOtherConfigFlag */
-#ifdef MIP6
- int haflg; /* HAFlag */
-#endif
int rtpref; /* router preference */
u_int32_t linkmtu; /* AdvLinkMTU */
@@ -145,10 +131,6 @@ struct rainfo {
int pfxs; /* number of prefixes */
long clockskew; /* used for consisitency check of lifetimes */
-#ifdef MIP6
- u_short hapref; /* Home Agent Preference */
- u_short hatime; /* Home Agent Lifetime */
-#endif
struct rtinfo route; /* route information option (link head) */
int routes; /* number of route information options */
@@ -174,6 +156,3 @@ struct rainfo *if_indextorainfo __P((int));
struct prefix *find_prefix __P((struct rainfo *, struct in6_addr *, int));
extern struct in6_addr in6a_site_allrouters;
-#ifdef MIP6
-extern int mobileip6;
-#endif
OpenPOWER on IntegriCloud