summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2011-05-02 09:24:01 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2011-05-02 09:24:01 +0000
commitac18c68ddf12ebf888a153e8f7fd5e619b764937 (patch)
treedde8f5bbfa847dca948323132caceaa88c0c76d1
parent00619fee8410089f25bfe9ae5f5cf534abe1e4d3 (diff)
Some cleanup, some KNF and sync non functional differences with
ospfd's version.
-rw-r--r--usr.sbin/ospf6d/ospfe.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index f90cc3b9192..a8ef62dedc0 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.33 2010/08/22 20:27:52 bluhm Exp $ */
+/* $OpenBSD: ospfe.c,v 1.34 2011/05/02 09:24:00 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -178,7 +178,7 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2],
TAILQ_INIT(&ctl_conns);
control_listen();
- if ((pkt_ptr = calloc(1, IBUF_READ_SIZE)) == NULL)
+ if ((pkt_ptr = calloc(1, READ_BUF_SIZE)) == NULL)
fatal("ospfe");
/* start interfaces */
@@ -804,7 +804,7 @@ orig_rtr_lsa_area(struct area *area)
rtr_link.nbr_iface_id = htonl(nbr->iface_id);
rtr_link.nbr_rtr_id = nbr->id.s_addr;
if (ibuf_add(buf, &rtr_link, sizeof(rtr_link)))
- fatalx("orig_rtr_lsa: buf_add failed");
+ fatalx("orig_rtr_lsa: ibuf_add failed");
}
continue;
case IF_TYPE_BROADCAST:
@@ -831,7 +831,7 @@ orig_rtr_lsa_area(struct area *area)
if (ibuf_add(buf, &rtr_link,
sizeof(rtr_link)))
fatalx("orig_rtr_lsa: "
- "buf_add failed");
+ "ibuf_add failed");
break;
}
}
@@ -855,7 +855,7 @@ orig_rtr_lsa_area(struct area *area)
rtr_link.metric = htons(iface->metric);
virtual = 1;
if (ibuf_add(buf, &rtr_link, sizeof(rtr_link)))
- fatalx("orig_rtr_lsa: buf_add failed");
+ fatalx("orig_rtr_lsa: ibuf_add failed");
log_debug("orig_rtr_lsa: virtual link, "
"interface %s", iface->name);
@@ -869,7 +869,7 @@ orig_rtr_lsa_area(struct area *area)
rtr_link.type = LINK_TYPE_STUB_NET;
rtr_link.metric = htons(iface->metric);
if (ibuf_add(buf, &rtr_link, sizeof(rtr_link)))
- fatalx("orig_rtr_lsa: buf_add failed");
+ fatalx("orig_rtr_lsa: ibuf_add failed");
LIST_FOREACH(nbr, &iface->nbr_list, entry) {
if (nbr != iface->self &&
@@ -891,7 +891,7 @@ orig_rtr_lsa_area(struct area *area)
if (ibuf_add(buf, &rtr_link,
sizeof(rtr_link)))
fatalx("orig_rtr_lsa: "
- "buf_add failed");
+ "ibuf_add failed");
}
}
continue;
@@ -985,7 +985,7 @@ orig_net_lsa(struct iface *iface)
}
if (num_rtr == 1) {
- /* non transit net therefor no need to generate a net lsa */
+ /* non transit net therefore no need to generate a net lsa */
ibuf_free(buf);
return;
}
@@ -1143,8 +1143,8 @@ ospfe_iface_ctl(struct ctl_conn *c, unsigned int idx)
if (idx == 0 || idx == iface->ifindex) {
ictl = if_to_ctl(iface);
imsg_compose_event(&c->iev,
- IMSG_CTL_SHOW_INTERFACE,
- 0, 0, -1, ictl, sizeof(struct ctl_iface));
+ IMSG_CTL_SHOW_INTERFACE, 0, 0, -1,
+ ictl, sizeof(struct ctl_iface));
}
}
@@ -1181,7 +1181,7 @@ ospfe_demote_area(struct area *area, int active)
bzero(&dmsg, sizeof(dmsg));
strlcpy(dmsg.demote_group, area->demote_group,
- sizeof(dmsg.demote_group));
+ sizeof(dmsg.demote_group));
dmsg.level = area->demote_level;
if (active)
dmsg.level = -dmsg.level;
@@ -1206,5 +1206,8 @@ ospfe_demote_iface(struct iface *iface, int active)
else
dmsg.level = 1;
+ log_warnx("ospfe_demote_iface: group %s level %d", dmsg.demote_group,
+ dmsg.level);
+
ospfe_imsg_compose_parent(IMSG_DEMOTE, 0, &dmsg, sizeof(dmsg));
}