Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rwestphal committed Sep 2, 2016
1 parent b0ce0b5 commit 6b7ee92
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 17 deletions.
1 change: 0 additions & 1 deletion eigrpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ struct imsgev {
struct imsgbuf ibuf;
void (*handler)(int, short, void *);
struct event ev;
void *data;
short events;
};

Expand Down
4 changes: 1 addition & 3 deletions eigrpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ eigrpe_sig_handler(int sig, short event, void *bula)
}

/* eigrp engine */
pid_t
void
eigrpe(int debug, int verbose, char *sockname)
{
struct passwd *pw;
Expand Down Expand Up @@ -173,8 +173,6 @@ eigrpe(int debug, int verbose, char *sockname)
event_dispatch();

eigrpe_shutdown();
/* NOTREACHED */
return (0);
}

static __dead void
Expand Down
2 changes: 1 addition & 1 deletion eigrpe.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RB_PROTOTYPE(nbr_pid_head, nbr, pid_tree, nbr_pid_compare)
extern struct eigrpd_conf *econf;

/* eigrpe.c */
pid_t eigrpe(int, int, char *);
void eigrpe(int, int, char *);
int eigrpe_imsg_compose_parent(int, pid_t, void *, uint16_t);
int eigrpe_imsg_compose_rde(int, uint32_t, pid_t, void *,
uint16_t);
Expand Down
4 changes: 2 additions & 2 deletions log.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ if_type_name(enum iface_type type)
return ("POINTOPOINT");
case IF_TYPE_BROADCAST:
return ("BROADCAST");
default:
return ("UNKNOWN");
}
/* NOTREACHED */
return ("UNKNOWN");
}

const char *
Expand Down
2 changes: 1 addition & 1 deletion query.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ send_query(struct eigrp_iface *ei, struct nbr *nbr,
if (rinfo_list == NULL || TAILQ_EMPTY(rinfo_list))
return;

/* don't exceed the interface's mtu */
do {
if ((buf = ibuf_dynamic(PKG_DEF_SIZE,
IP_MAXPACKET - sizeof(struct ip))) == NULL)
Expand Down Expand Up @@ -72,6 +71,7 @@ send_query(struct eigrp_iface *ei, struct nbr *nbr,

while ((re = TAILQ_FIRST(rinfo_list)) != NULL) {
route_len = len_route_tlv(&re->rinfo);
/* don't exceed the MTU to avoid IP fragmentation */
if (size + route_len > ei->iface->mtu) {
rtp_send(ei, nbr, buf);
break;
Expand Down
5 changes: 1 addition & 4 deletions rde.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ rde_sig_handler(int sig, short event, void *arg)
}

/* route decision engine */
pid_t
void
rde(int debug, int verbose)
{
struct event ev_sigint, ev_sigterm;
Expand Down Expand Up @@ -126,9 +126,6 @@ rde(int debug, int verbose)
event_dispatch();

rde_shutdown();
/* NOTREACHED */

return (0);
}

static __dead void
Expand Down
2 changes: 1 addition & 1 deletion rde.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extern struct eigrpd_conf *rdeconf;
extern struct rde_nbr_head rde_nbrs;

/* rde.c */
pid_t rde(int, int);
void rde(int, int);
int rde_imsg_compose_parent(int, pid_t, void *, uint16_t);
int rde_imsg_compose_eigrpe(int, uint32_t, pid_t, void *,
uint16_t);
Expand Down
2 changes: 1 addition & 1 deletion reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ send_reply(struct nbr *nbr, struct rinfo_head *rinfo_list, int siareply)
if (rinfo_list == NULL || TAILQ_EMPTY(rinfo_list))
return;

/* don't exceed the interface's mtu */
do {
if ((buf = ibuf_dynamic(PKG_DEF_SIZE,
IP_MAXPACKET - sizeof(struct ip))) == NULL)
Expand Down Expand Up @@ -71,6 +70,7 @@ send_reply(struct nbr *nbr, struct rinfo_head *rinfo_list, int siareply)

while ((re = TAILQ_FIRST(rinfo_list)) != NULL) {
route_len = len_route_tlv(&re->rinfo);
/* don't exceed the MTU to avoid IP fragmentation */
if (size + route_len > nbr->ei->iface->mtu) {
rtp_send_ucast(nbr, buf);
break;
Expand Down
6 changes: 4 additions & 2 deletions tlv.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,15 @@ tlv_decode_seq(int af, struct tlv *tlv, char *buf,
switch (af) {
case AF_INET:
if (alen != INADDRSZ) {
log_debug("%s: invalid address length", __func__);
log_debug("%s: invalid address length",
__func__);
return (-1);
}
break;
case AF_INET6:
if (alen != IN6ADDRSZ) {
log_debug("%s: invalid address length", __func__);
log_debug("%s: invalid address length",
__func__);
return (-1);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion update.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ send_update(struct eigrp_iface *ei, struct nbr *nbr, uint32_t flags,
int size;
int route_len;

/* don't exceed the interface's mtu */
do {
if ((buf = ibuf_dynamic(PKG_DEF_SIZE,
IP_MAXPACKET - sizeof(struct ip))) == NULL)
Expand Down Expand Up @@ -67,6 +66,7 @@ send_update(struct eigrp_iface *ei, struct nbr *nbr, uint32_t flags,

while ((re = TAILQ_FIRST(rinfo_list)) != NULL) {
route_len = len_route_tlv(&re->rinfo);
/* don't exceed the MTU to avoid IP fragmentation */
if (size + route_len > ei->iface->mtu) {
rtp_send(ei, nbr, buf);
break;
Expand Down

0 comments on commit 6b7ee92

Please sign in to comment.