* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
#include "routemap.h"
#include "if_rmap.h"
#include "privs.h"
+#include "lib_errors.h"
#include "ripngd/ripngd.h"
#include "ripngd/ripng_route.h"
ripng_changed_route,
};
-extern struct zebra_privs_t ripngd_privs;
-
/* Prototypes. */
void ripng_output_process(struct interface *, struct sockaddr_in6 *, int);
sock = socket(AF_INET6, SOCK_DGRAM, 0);
if (sock < 0) {
- zlog_err("Can't make ripng socket");
+ flog_err_sys(LIB_ERR_SOCKET, "Can't make ripng socket");
return sock;
}
setsockopt_so_recvbuf(sock, 8096);
ret = setsockopt_ipv6_pktinfo(sock, 1);
if (ret < 0)
- return ret;
+ goto error;
#ifdef IPTOS_PREC_INTERNETCONTROL
ret = setsockopt_ipv6_tclass(sock, IPTOS_PREC_INTERNETCONTROL);
if (ret < 0)
- return ret;
+ goto error;
#endif
ret = setsockopt_ipv6_multicast_hops(sock, 255);
if (ret < 0)
- return ret;
+ goto error;
ret = setsockopt_ipv6_multicast_loop(sock, 0);
if (ret < 0)
- return ret;
+ goto error;
ret = setsockopt_ipv6_hoplimit(sock, 1);
if (ret < 0)
- return ret;
+ goto error;
memset(&ripaddr, 0, sizeof(ripaddr));
ripaddr.sin6_family = AF_INET6;
#endif /* SIN6_LEN */
ripaddr.sin6_port = htons(RIPNG_PORT_DEFAULT);
- if (ripngd_privs.change(ZPRIVS_RAISE))
- zlog_err("ripng_make_socket: could not raise privs");
+ frr_elevate_privs(&ripngd_privs) {
- ret = bind(sock, (struct sockaddr *)&ripaddr, sizeof(ripaddr));
- if (ret < 0) {
- zlog_err("Can't bind ripng socket: %s.", safe_strerror(errno));
- if (ripngd_privs.change(ZPRIVS_LOWER))
- zlog_err("ripng_make_socket: could not lower privs");
- return ret;
+ ret = bind(sock, (struct sockaddr *)&ripaddr, sizeof(ripaddr));
+ if (ret < 0) {
+ zlog_err("Can't bind ripng socket: %s.", safe_strerror(errno));
+ goto error;
+ }
}
- if (ripngd_privs.change(ZPRIVS_LOWER))
- zlog_err("ripng_make_socket: could not lower privs");
return sock;
+
+error:
+ close(sock);
+ return ret;
}
/* Send RIPng packet. */
addr.sin6_port = htons(RIPNG_PORT_DEFAULT);
}
+ memset(&msg, 0, sizeof(msg));
msg.msg_name = (void *)&addr;
msg.msg_namelen = sizeof(struct sockaddr_in6);
msg.msg_iov = &iov;
if (ret < 0) {
if (to)
- zlog_err("RIPng send fail on %s to %s: %s", ifp->name,
- inet6_ntoa(to->sin6_addr),
- safe_strerror(errno));
+ flog_err_sys(LIB_ERR_SOCKET,
+ "RIPng send fail on %s to %s: %s",
+ ifp->name, inet6_ntoa(to->sin6_addr),
+ safe_strerror(errno));
else
- zlog_err("RIPng send fail on %s: %s", ifp->name,
- safe_strerror(errno));
+ flog_err_sys(LIB_ERR_SOCKET,
+ "RIPng send fail on %s: %s", ifp->name,
+ safe_strerror(errno));
}
return ret;
}
/* Receive UDP RIPng packet from socket. */
-static int ripng_recv_packet(int sock, u_char *buf, int bufsize,
+static int ripng_recv_packet(int sock, uint8_t *buf, int bufsize,
struct sockaddr_in6 *from, ifindex_t *ifindex,
int *hoplimit)
{
char adata[1024];
/* Fill in message and iovec. */
+ memset(&msg, 0, sizeof(msg));
msg.msg_name = (void *)from;
msg.msg_namelen = sizeof(struct sockaddr_in6);
msg.msg_iov = &iov;
/* Unlock route_node. */
listnode_delete(rp->info, rinfo);
if (list_isempty((struct list *)rp->info)) {
- list_free(rp->info);
- rp->info = NULL;
+ list_delete_and_null((struct list **)&rp->info);
route_unlock_node(rp);
}
unusable). */
if (rte->metric != RIPNG_METRIC_INFINITY)
ripng_ecmp_add(&newinfo);
+ else
+ route_unlock_node(rp);
} else {
/* If there is an existing route, compare the next hop address
to the address of the router from which the datagram came.
enabled interface. */
static int ripng_update(struct thread *t)
{
- struct listnode *node;
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
struct ripng_interface *ri;
zlog_debug("RIPng update timer expired!");
/* Supply routes to each interface. */
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
ri = ifp->info;
if (if_is_loopback(ifp) || !if_is_up(ifp))
/* Execute triggered update. */
int ripng_triggered_update(struct thread *t)
{
- struct listnode *node;
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
struct ripng_interface *ri;
int interval;
/* Split Horizon processing is done when generating triggered
updates as well as normal updates (see section 2.6). */
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
ri = ifp->info;
if (if_is_loopback(ifp) || !if_is_up(ifp))
update is triggered when the timer expires. */
interval = (random() % 5) + 1;
- ripng->t_triggered_interval = thread_add_timer(
- master, ripng_triggered_interval, NULL, interval);
+ ripng->t_triggered_interval = NULL;
+ thread_add_timer(master, ripng_triggered_interval, NULL, interval,
+ &ripng->t_triggered_interval);
return 0;
}
/* Write routing table entry to the stream and return next index of
the routing table entry in the stream. */
int ripng_write_rte(int num, struct stream *s, struct prefix_ipv6 *p,
- struct in6_addr *nexthop, u_int16_t tag, u_char metric)
+ struct in6_addr *nexthop, uint16_t tag, uint8_t metric)
{
/* RIPng packet header. */
if (num == 0) {
}
/* Write routing table entry. */
- if (!nexthop)
- stream_write(s, (u_char *)&p->prefix, sizeof(struct in6_addr));
- else
- stream_write(s, (u_char *)nexthop, sizeof(struct in6_addr));
+ if (!nexthop) {
+ assert(p);
+ stream_write(s, (uint8_t *)&p->prefix, sizeof(struct in6_addr));
+ } else
+ stream_write(s, (uint8_t *)nexthop, sizeof(struct in6_addr));
stream_putw(s, tag);
if (p)
stream_putc(s, p->prefixlen);
switch (event) {
case RIPNG_READ:
- if (!ripng->t_read)
- ripng->t_read =
- thread_add_read(master, ripng_read, NULL, sock);
+ thread_add_read(master, ripng_read, NULL, sock, &ripng->t_read);
break;
case RIPNG_UPDATE_EVENT:
if (ripng->t_update) {
/* Update timer jitter. */
jitter = ripng_update_jitter(ripng->update_time);
- ripng->t_update = thread_add_timer(
- master, ripng_update, NULL,
- sock ? 2 : ripng->update_time + jitter);
+ ripng->t_update = NULL;
+ thread_add_timer(master, ripng_update, NULL,
+ sock ? 2 : ripng->update_time + jitter,
+ &ripng->t_update);
break;
case RIPNG_TRIGGERED_UPDATE:
if (ripng->t_triggered_interval)
ripng->trigger = 1;
- else if (!ripng->t_triggered_update)
- ripng->t_triggered_update = thread_add_event(
- master, ripng_triggered_update, NULL, 0);
+ else
+ thread_add_event(master, ripng_triggered_update, NULL,
+ 0, &ripng->t_triggered_update);
break;
default:
break;
/* Header of display. */
vty_out(vty,
- "Codes: R - RIPng, C - connected, S - Static, O - OSPF, B - BGP%s"
- "Sub-codes:%s"
- " (n) - normal, (s) - static, (d) - default, (r) - redistribute,%s"
- " (i) - interface, (a/S) - aggregated/Suppressed%s%s"
- " Network Next Hop Via Metric Tag Time%s",
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE,
- VTY_NEWLINE);
+ "Codes: R - RIPng, C - connected, S - Static, O - OSPF, B - BGP\n"
+ "Sub-codes:\n"
+ " (n) - normal, (s) - static, (d) - default, (r) - redistribute,\n"
+ " (i) - interface, (a/S) - aggregated/Suppressed\n\n"
+ " Network Next Hop Via Metric Tag Time\n");
for (rp = route_top(ripng->table); rp; rp = route_next(rp)) {
if ((aggregate = rp->aggregate) != NULL) {
vty_out(vty, "R(a) %s/%d ", inet6_ntoa(p->prefix),
p->prefixlen);
#endif /* DEBUG */
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "\n");
vty_out(vty, "%*s", 18, " ");
vty_out(vty, "%*s", 28, " ");
- vty_out(vty, "self %2d %3" ROUTE_TAG_PRI "%s",
- aggregate->metric, (route_tag_t)aggregate->tag,
- VTY_NEWLINE);
+ vty_out(vty, "self %2d %3" ROUTE_TAG_PRI "\n",
+ aggregate->metric, (route_tag_t)aggregate->tag);
}
if ((list = rp->info) != NULL)
ripng_route_subtype_print(rinfo),
inet6_ntoa(p->prefix), p->prefixlen);
#endif /* DEBUG */
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "\n");
vty_out(vty, "%*s", 18, " ");
len = vty_out(vty, "%s",
inet6_ntoa(rinfo->nexthop));
len = 28 - len;
if (len > 0)
- len = vty_out(vty, "%*s", len, " ");
+ vty_out(vty, "%*s", len, " ");
/* from */
if ((rinfo->type == ZEBRA_ROUTE_RIPNG)
ripng_vty_out_uptime(vty, rinfo);
}
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "\n");
}
}
"Show RIPng routes\n"
"IPv6 routing protocol process parameters and statistics\n")
{
- struct listnode *node;
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
if (!ripng)
return CMD_SUCCESS;
- vty_out(vty, "Routing Protocol is \"RIPng\"%s", VTY_NEWLINE);
+ vty_out(vty, "Routing Protocol is \"RIPng\"\n");
vty_out(vty, " Sending updates every %ld seconds with +/-50%%,",
ripng->update_time);
- vty_out(vty, " next due in %lu seconds%s",
- thread_timer_remain_second(ripng->t_update), VTY_NEWLINE);
+ vty_out(vty, " next due in %lu seconds\n",
+ thread_timer_remain_second(ripng->t_update));
vty_out(vty, " Timeout after %ld seconds,", ripng->timeout_time);
- vty_out(vty, " garbage collect after %ld seconds%s",
- ripng->garbage_time, VTY_NEWLINE);
+ vty_out(vty, " garbage collect after %ld seconds\n",
+ ripng->garbage_time);
/* Filtering status show. */
config_show_distribute(vty);
/* Default metric information. */
- vty_out(vty, " Default redistribution metric is %d%s",
- ripng->default_metric, VTY_NEWLINE);
+ vty_out(vty, " Default redistribution metric is %d\n",
+ ripng->default_metric);
/* Redistribute information. */
vty_out(vty, " Redistributing:");
ripng_redistribute_write(vty, 0);
- vty_out(vty, "%s", VTY_NEWLINE);
+ vty_out(vty, "\n");
vty_out(vty, " Default version control: send version %d,",
ripng->version);
- vty_out(vty, " receive version %d %s", ripng->version, VTY_NEWLINE);
+ vty_out(vty, " receive version %d \n", ripng->version);
- vty_out(vty, " Interface Send Recv%s", VTY_NEWLINE);
+ vty_out(vty, " Interface Send Recv\n");
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
struct ripng_interface *ri;
ri = ifp->info;
if (ri->enable_network || ri->enable_interface) {
- vty_out(vty, " %-17s%-3d %-3d%s", ifp->name,
- ripng->version, ripng->version, VTY_NEWLINE);
+ vty_out(vty, " %-17s%-3d %-3d\n", ifp->name,
+ ripng->version, ripng->version);
}
}
- vty_out(vty, " Routing for Networks:%s", VTY_NEWLINE);
+ vty_out(vty, " Routing for Networks:\n");
ripng_network_write(vty, 0);
- vty_out(vty, " Routing Information Sources:%s", VTY_NEWLINE);
+ vty_out(vty, " Routing Information Sources:\n");
vty_out(vty,
- " Gateway BadPackets BadRoutes Distance Last Update%s",
- VTY_NEWLINE);
+ " Gateway BadPackets BadRoutes Distance Last Update\n");
ripng_peer_display(vty);
return CMD_SUCCESS;
"clear ipv6 ripng",
CLEAR_STR
IPV6_STR
- "Clear IPv6 RIP database")
+ "Clear IPv6 RIP database\n")
{
struct route_node *rp;
struct ripng_info *rinfo;
}
if (list_isempty(list)) {
- list_free(list);
+ list_delete_and_null(&list);
rp->info = NULL;
route_unlock_node(rp);
}
/* Notice to user we couldn't create RIPng. */
if (ret < 0) {
zlog_warn("can't create RIPng");
- return CMD_WARNING;
+ return CMD_WARNING_CONFIG_FAILED;
}
}
ret = str2prefix_ipv6(argv[idx_ipv6addr]->arg,
(struct prefix_ipv6 *)&p);
if (ret <= 0) {
- vty_out(vty, "Malformed address%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Malformed address\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
apply_mask_ipv6(&p);
rp = route_node_get(ripng->route, (struct prefix *)&p);
if (rp->info) {
- vty_out(vty, "There is already same static route.%s",
- VTY_NEWLINE);
+ vty_out(vty, "There is already same static route.\n");
route_unlock_node(rp);
return CMD_WARNING;
}
ret = str2prefix_ipv6(argv[idx_ipv6addr]->arg,
(struct prefix_ipv6 *)&p);
if (ret <= 0) {
- vty_out(vty, "Malformed address%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Malformed address\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
apply_mask_ipv6(&p);
rp = route_node_lookup(ripng->route, (struct prefix *)&p);
if (!rp) {
- vty_out(vty, "Can't find static route.%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Can't find static route.\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng_redistribute_delete(ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0);
ret = str2prefix_ipv6(argv[idx_ipv6_prefixlen]->arg,
(struct prefix_ipv6 *)&p);
if (ret <= 0) {
- vty_out(vty, "Malformed address%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Malformed address\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
/* Check aggregate alredy exist or not. */
node = route_node_get(ripng->aggregate, &p);
if (node->info) {
- vty_out(vty, "There is already same aggregate route.%s",
- VTY_NEWLINE);
+ vty_out(vty, "There is already same aggregate route.\n");
route_unlock_node(node);
return CMD_WARNING;
}
"no aggregate-address X:X::X:X/M",
NO_STR
"Delete aggregate RIPng route announcement\n"
- "Aggregate network")
+ "Aggregate network\n")
{
int idx_ipv6_prefixlen = 2;
int ret;
ret = str2prefix_ipv6(argv[idx_ipv6_prefixlen]->arg,
(struct prefix_ipv6 *)&p);
if (ret <= 0) {
- vty_out(vty, "Malformed address%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Malformed address\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
rn = route_node_lookup(ripng->aggregate, &p);
if (!rn) {
- vty_out(vty, "Can't find aggregate route.%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out(vty, "Can't find aggregate route.\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
route_unlock_node(rn);
rn->info = 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;
+ vty_out (vty, "update timer value error\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->update_time = update;
timeout = strtoul (argv[0], &endptr, 10);
if (timeout == ULONG_MAX || *endptr != '\0')
{
- vty_out (vty, "timeout timer value error%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out (vty, "timeout timer value error\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->timeout_time = timeout;
garbage = strtoul (argv[0], &endptr, 10);
if (garbage == ULONG_MAX || *endptr != '\0')
{
- vty_out (vty, "garbage timer value error%s", VTY_NEWLINE);
- return CMD_WARNING;
+ vty_out (vty, "garbage timer value error\n");
+ return CMD_WARNING_CONFIG_FAILED;
}
ripng->garbage_time = garbage;
unsigned long timeout;
unsigned long garbage;
- VTY_GET_INTEGER_RANGE("update timer", update, argv[idx_number]->arg, 0,
- 65535);
- VTY_GET_INTEGER_RANGE("timeout timer", timeout, argv[idx_number_2]->arg,
- 0, 65535);
- VTY_GET_INTEGER_RANGE("garbage timer", garbage, argv[idx_number_3]->arg,
- 0, 65535);
+ update = strtoul(argv[idx_number]->arg, NULL, 10);
+ timeout = strtoul(argv[idx_number_2]->arg, NULL, 10);
+ garbage = strtoul(argv[idx_number_3]->arg, NULL, 10);
/* Set each timer value. */
ripng->update_time = update;
"show ipv6 protocols",
SHOW_STR
IPV6_STR
- "Routing protocol information")
+ "Routing protocol information\n")
{
if (! ripng)
return CMD_SUCCESS;
- vty_out (vty, "Routing Protocol is \"ripng\"%s", VTY_NEWLINE);
+ vty_out (vty, "Routing Protocol is \"ripng\"\n");
- vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds%s",
- ripng->update_time, 0,
- VTY_NEWLINE);
+ vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds\n",
+ ripng->update_time, 0);
- vty_out (vty, "Timerout after %ld seconds, garbage correct %ld%s",
+ vty_out (vty, "Timerout after %ld seconds, garbage correct %ld\n",
ripng->timeout_time,
- ripng->garbage_time,
- VTY_NEWLINE);
+ ripng->garbage_time);
vty_out (vty, "Outgoing update filter list for all interfaces is not set");
vty_out (vty, "Incoming update filter list for all interfaces is not set");
"Allow Equal Cost MultiPath\n")
{
if (ripng->ecmp) {
- vty_out(vty, "ECMP is already enabled.%s", VTY_NEWLINE);
+ vty_out(vty, "ECMP is already enabled.\n");
return CMD_WARNING;
}
"Allow Equal Cost MultiPath\n")
{
if (!ripng->ecmp) {
- vty_out(vty, "ECMP is already disabled.%s", VTY_NEWLINE);
+ vty_out(vty, "ECMP is already disabled.\n");
return CMD_WARNING;
}
if (ripng) {
/* RIPng router. */
- vty_out(vty, "router ripng%s", VTY_NEWLINE);
+ vty_out(vty, "router ripng\n");
if (ripng->default_information)
- vty_out(vty, " default-information originate%s",
- VTY_NEWLINE);
+ vty_out(vty, " default-information originate\n");
ripng_network_write(vty, 1);
/* RIPng default metric configuration */
if (ripng->default_metric != RIPNG_DEFAULT_METRIC_DEFAULT)
- vty_out(vty, " default-metric %d%s",
- ripng->default_metric, VTY_NEWLINE);
+ vty_out(vty, " default-metric %d\n",
+ ripng->default_metric);
ripng_redistribute_write(vty, 1);
/* RIPng aggregate routes. */
for (rp = route_top(ripng->aggregate); rp; rp = route_next(rp))
if (rp->info != NULL)
- vty_out(vty, " aggregate-address %s/%d%s",
+ vty_out(vty, " aggregate-address %s/%d\n",
inet6_ntoa(rp->p.u.prefix6),
- rp->p.prefixlen,
-
- VTY_NEWLINE);
+ rp->p.prefixlen);
/* ECMP configuration. */
if (ripng->ecmp)
- vty_out(vty, " allow-ecmp%s", VTY_NEWLINE);
+ vty_out(vty, " allow-ecmp\n");
/* RIPng static routes. */
for (rp = route_top(ripng->route); rp; rp = route_next(rp))
if (rp->info != NULL)
- vty_out(vty, " route %s/%d%s",
+ vty_out(vty, " route %s/%d\n",
inet6_ntoa(rp->p.u.prefix6),
- rp->p.prefixlen, VTY_NEWLINE);
+ rp->p.prefixlen);
/* RIPng timers configuration. */
if (ripng->update_time != RIPNG_UPDATE_TIMER_DEFAULT
|| ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT
|| ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT) {
- vty_out(vty, " timers basic %ld %ld %ld%s",
+ vty_out(vty, " timers basic %ld %ld %ld\n",
ripng->update_time, ripng->timeout_time,
- ripng->garbage_time, VTY_NEWLINE);
+ ripng->garbage_time);
}
#if 0
if (ripng->update_time != RIPNG_UPDATE_TIMER_DEFAULT)
- vty_out (vty, " update-timer %d%s", ripng->update_time,
- VTY_NEWLINE);
+ vty_out (vty, " update-timer %d\n", ripng->update_time);
if (ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT)
- vty_out (vty, " timeout-timer %d%s", ripng->timeout_time,
- VTY_NEWLINE);
+ vty_out (vty, " timeout-timer %d\n", ripng->timeout_time);
if (ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT)
- vty_out (vty, " garbage-timer %d%s", ripng->garbage_time,
- VTY_NEWLINE);
+ vty_out (vty, " garbage-timer %d\n", ripng->garbage_time);
#endif /* 0 */
write += config_write_distribute(vty);
/* Update all interface's distribute list. */
static void ripng_distribute_update_all(struct prefix_list *notused)
{
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- struct listnode *node;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp))
+ FOR_ALL_INTERFACES (vrf, ifp)
ripng_distribute_update_interface(ifp);
}
rinfo->t_garbage_collect);
ripng_info_free(rinfo);
}
- list_delete(list);
+ list_delete_and_null(&list);
rp->info = NULL;
route_unlock_node(rp);
}
static void ripng_routemap_update(const char *unused)
{
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
- struct listnode *node;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp))
+ FOR_ALL_INTERFACES (vrf, ifp)
ripng_if_rmap_update_interface(ifp);
ripng_routemap_update_redistribute();