From 6d0732c8abad7ace509d033a41814ea03a3a1b16 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 28 Sep 2011 14:23:35 +0400 Subject: IPv6 transport class suppport IPv6 supports the same concept of differentiated service for routing protocols as IPv4, but like too many things, the standards committee decided that having two names for the same thing wasn't good enough and introduced a third more generic term transport class. The socket option to set transport class works the same as IPv4, but the arguments are different. * lib/sockopt.[ch] * setsockopt_ipv6_tclass(): new function * bgpd/bgp_network.c * bgp_connect(): set socket option * bgp_listener(): set socket option * ospf6d/ospf6_network.c * ospf6_set_transport_class(): new function * ospf6_serv_sock(): set socket option * ripngd/ripngd.c * ripng_make_socket(): set socket option --- ripngd/ripngd.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ripngd/ripngd.c') diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 6e32d83c..d416255c 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -117,6 +117,11 @@ ripng_make_socket (void) ret = setsockopt_ipv6_pktinfo (sock, 1); if (ret < 0) return ret; +#ifdef IPTOS_PREC_INTERNETCONTROL + ret = setsockopt_ipv6_tclass (sock, IPTOS_PREC_INTERNETCONTROL); + if (ret < 0) + return ret; +#endif ret = setsockopt_ipv6_multicast_hops (sock, 255); if (ret < 0) return ret; -- cgit v1.2.1 From 6989880ad7699cb6bf0cfc0fbb95da51430652cf Mon Sep 17 00:00:00 2001 From: Ulrich Weber Date: Thu, 17 Nov 2011 21:35:08 +0400 Subject: ripngd: limit max of "timers basic" to 65535 as documented and use VTY_GET_INTEGER_RANGE instead of calling strtoul --- ripngd/ripngd.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'ripngd/ripngd.c') diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index d416255c..8e97c2f8 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2485,28 +2485,10 @@ DEFUN (ripng_timers, unsigned long update; unsigned long timeout; unsigned long garbage; - char *endptr = NULL; - update = strtoul (argv[0], &endptr, 10); - if (update == ULONG_MAX || *endptr != '\0') - { - vty_out (vty, "update timer value error%s", VTY_NEWLINE); - return CMD_WARNING; - } - - timeout = strtoul (argv[1], &endptr, 10); - if (timeout == ULONG_MAX || *endptr != '\0') - { - vty_out (vty, "timeout timer value error%s", VTY_NEWLINE); - return CMD_WARNING; - } - - garbage = strtoul (argv[2], &endptr, 10); - if (garbage == ULONG_MAX || *endptr != '\0') - { - vty_out (vty, "garbage timer value error%s", VTY_NEWLINE); - return CMD_WARNING; - } + VTY_GET_INTEGER_RANGE("update timer", update, argv[0], 0, 65535); + VTY_GET_INTEGER_RANGE("timeout timer", timeout, argv[1], 0, 65535); + VTY_GET_INTEGER_RANGE("garbage timer", garbage, argv[2], 0, 65535); /* Set each timer value. */ ripng->update_time = update; -- cgit v1.2.1