diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-09-02 16:46:30 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-09-02 16:46:30 +0000 |
commit | 84c85a837994079abd132faae691bfa064184ee5 (patch) | |
tree | 09482eaf36d7f12246e1bca0ccf009314824ba80 /usr.sbin | |
parent | 87ae46400df7e5c46e75a22fe964ee06a55a9908 (diff) |
Minor tweaks
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/eigrpd/eigrpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/eigrpd/eigrpe.c | 6 | ||||
-rw-r--r-- | usr.sbin/eigrpd/eigrpe.h | 4 | ||||
-rw-r--r-- | usr.sbin/eigrpd/log.c | 6 | ||||
-rw-r--r-- | usr.sbin/eigrpd/query.c | 4 | ||||
-rw-r--r-- | usr.sbin/eigrpd/rde.c | 7 | ||||
-rw-r--r-- | usr.sbin/eigrpd/rde.h | 4 | ||||
-rw-r--r-- | usr.sbin/eigrpd/reply.c | 4 | ||||
-rw-r--r-- | usr.sbin/eigrpd/tlv.c | 8 | ||||
-rw-r--r-- | usr.sbin/eigrpd/update.c | 4 |
10 files changed, 23 insertions, 27 deletions
diff --git a/usr.sbin/eigrpd/eigrpd.h b/usr.sbin/eigrpd/eigrpd.h index 4a7cad10740..71985ad0115 100644 --- a/usr.sbin/eigrpd/eigrpd.h +++ b/usr.sbin/eigrpd/eigrpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpd.h,v 1.20 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: eigrpd.h,v 1.21 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -65,7 +65,6 @@ struct imsgev { struct imsgbuf ibuf; void (*handler)(int, short, void *); struct event ev; - void *data; short events; }; diff --git a/usr.sbin/eigrpd/eigrpe.c b/usr.sbin/eigrpd/eigrpe.c index 825064eac0d..5e891129fa5 100644 --- a/usr.sbin/eigrpd/eigrpe.c +++ b/usr.sbin/eigrpd/eigrpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpe.c,v 1.32 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: eigrpe.c,v 1.33 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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; @@ -173,8 +173,6 @@ eigrpe(int debug, int verbose, char *sockname) event_dispatch(); eigrpe_shutdown(); - /* NOTREACHED */ - return (0); } static __dead void diff --git a/usr.sbin/eigrpd/eigrpe.h b/usr.sbin/eigrpd/eigrpe.h index b1d8e6a6c59..06ca905780f 100644 --- a/usr.sbin/eigrpd/eigrpe.h +++ b/usr.sbin/eigrpd/eigrpe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpe.h,v 1.14 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: eigrpe.h,v 1.15 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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); diff --git a/usr.sbin/eigrpd/log.c b/usr.sbin/eigrpd/log.c index 2ed28a170a0..130f370bdec 100644 --- a/usr.sbin/eigrpd/log.c +++ b/usr.sbin/eigrpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.5 2016/09/02 16:29:55 renato Exp $ */ +/* $OpenBSD: log.c,v 1.6 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -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 * diff --git a/usr.sbin/eigrpd/query.c b/usr.sbin/eigrpd/query.c index 70d60d81b7b..78366374458 100644 --- a/usr.sbin/eigrpd/query.c +++ b/usr.sbin/eigrpd/query.c @@ -1,4 +1,4 @@ -/* $OpenBSD: query.c,v 1.4 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: query.c,v 1.5 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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) @@ -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; diff --git a/usr.sbin/eigrpd/rde.c b/usr.sbin/eigrpd/rde.c index aea52e4f66c..9a48b40c3e9 100644 --- a/usr.sbin/eigrpd/rde.c +++ b/usr.sbin/eigrpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.22 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: rde.c,v 1.23 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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; @@ -126,9 +126,6 @@ rde(int debug, int verbose) event_dispatch(); rde_shutdown(); - /* NOTREACHED */ - - return (0); } static __dead void diff --git a/usr.sbin/eigrpd/rde.h b/usr.sbin/eigrpd/rde.h index 55122ffd41d..8cba225e3db 100644 --- a/usr.sbin/eigrpd/rde.h +++ b/usr.sbin/eigrpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.11 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: rde.h,v 1.12 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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); diff --git a/usr.sbin/eigrpd/reply.c b/usr.sbin/eigrpd/reply.c index f12f6dae10a..52dc2c6a789 100644 --- a/usr.sbin/eigrpd/reply.c +++ b/usr.sbin/eigrpd/reply.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reply.c,v 1.4 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: reply.c,v 1.5 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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) @@ -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; diff --git a/usr.sbin/eigrpd/tlv.c b/usr.sbin/eigrpd/tlv.c index 4046c82c0ef..464ddd75e39 100644 --- a/usr.sbin/eigrpd/tlv.c +++ b/usr.sbin/eigrpd/tlv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlv.c,v 1.13 2016/09/02 16:29:55 renato Exp $ */ +/* $OpenBSD: tlv.c,v 1.14 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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; diff --git a/usr.sbin/eigrpd/update.c b/usr.sbin/eigrpd/update.c index 03b38fb35cd..da045a569c6 100644 --- a/usr.sbin/eigrpd/update.c +++ b/usr.sbin/eigrpd/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.5 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: update.c,v 1.6 2016/09/02 16:46:29 renato Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -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) @@ -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; |