View | Details | Raw Unified | Return to bug 210148
Collapse All | Expand All

(-)sys/netinet6/in6.c (-44 lines)
Lines 360-366 Link Here
360
	case SIOCSPFXFLUSH_IN6:
360
	case SIOCSPFXFLUSH_IN6:
361
	case SIOCSRTRFLUSH_IN6:
361
	case SIOCSRTRFLUSH_IN6:
362
	case SIOCGIFALIFETIME_IN6:
362
	case SIOCGIFALIFETIME_IN6:
363
	case SIOCSIFALIFETIME_IN6:
364
	case SIOCGIFSTAT_IN6:
363
	case SIOCGIFSTAT_IN6:
365
	case SIOCGIFSTAT_ICMP6:
364
	case SIOCGIFSTAT_ICMP6:
366
		sa6 = &ifr->ifr_addr;
365
		sa6 = &ifr->ifr_addr;
Lines 459-492 Link Here
459
			goto out;
458
			goto out;
460
		}
459
		}
461
		break;
460
		break;
462
463
	case SIOCSIFALIFETIME_IN6:
464
	    {
465
		struct in6_addrlifetime *lt;
466
467
		if (td != NULL) {
468
			error = priv_check(td, PRIV_NETINET_ALIFETIME6);
469
			if (error)
470
				goto out;
471
		}
472
		if (ia == NULL) {
473
			error = EADDRNOTAVAIL;
474
			goto out;
475
		}
476
		/* sanity for overflow - beware unsigned */
477
		lt = &ifr->ifr_ifru.ifru_lifetime;
478
		if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME &&
479
		    lt->ia6t_vltime + time_uptime < time_uptime) {
480
			error = EINVAL;
481
			goto out;
482
		}
483
		if (lt->ia6t_pltime != ND6_INFINITE_LIFETIME &&
484
		    lt->ia6t_pltime + time_uptime < time_uptime) {
485
			error = EINVAL;
486
			goto out;
487
		}
488
		break;
489
	    }
490
	}
461
	}
491
462
492
	switch (cmd) {
463
	switch (cmd) {
Lines 572-592 Link Here
572
		}
543
		}
573
		break;
544
		break;
574
545
575
	case SIOCSIFALIFETIME_IN6:
576
		ia->ia6_lifetime = ifr->ifr_ifru.ifru_lifetime;
577
		/* for sanity */
578
		if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
579
			ia->ia6_lifetime.ia6t_expire =
580
				time_uptime + ia->ia6_lifetime.ia6t_vltime;
581
		} else
582
			ia->ia6_lifetime.ia6t_expire = 0;
583
		if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
584
			ia->ia6_lifetime.ia6t_preferred =
585
				time_uptime + ia->ia6_lifetime.ia6t_pltime;
586
		} else
587
			ia->ia6_lifetime.ia6t_preferred = 0;
588
		break;
589
590
	case SIOCAIFADDR_IN6:
546
	case SIOCAIFADDR_IN6:
591
	{
547
	{
592
		struct nd_prefixctl pr0;
548
		struct nd_prefixctl pr0;
(-)sys/netinet6/in6_var.h (-1 lines)
Lines 453-459 Link Here
453
#define SIOCSRTRFLUSH_IN6	_IOWR('i', 80, struct in6_ifreq)
453
#define SIOCSRTRFLUSH_IN6	_IOWR('i', 80, struct in6_ifreq)
454
454
455
#define SIOCGIFALIFETIME_IN6	_IOWR('i', 81, struct in6_ifreq)
455
#define SIOCGIFALIFETIME_IN6	_IOWR('i', 81, struct in6_ifreq)
456
#define SIOCSIFALIFETIME_IN6	_IOWR('i', 82, struct in6_ifreq)
457
#define SIOCGIFSTAT_IN6		_IOWR('i', 83, struct in6_ifreq)
456
#define SIOCGIFSTAT_IN6		_IOWR('i', 83, struct in6_ifreq)
458
#define SIOCGIFSTAT_ICMP6	_IOWR('i', 84, struct in6_ifreq)
457
#define SIOCGIFSTAT_ICMP6	_IOWR('i', 84, struct in6_ifreq)
459
458

Return to bug 210148