From: benno Date: Thu, 20 Sep 2018 11:06:04 +0000 (+0000) Subject: whitespace cleanup, ok claudio@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e068f2913ef2ce586ffed7c95538c4cecbf2f011;p=openbsd whitespace cleanup, ok claudio@ --- diff --git a/usr.sbin/bgpd/pfkey.c b/usr.sbin/bgpd/pfkey.c index 0092358fb30..509af578a85 100644 --- a/usr.sbin/bgpd/pfkey.c +++ b/usr.sbin/bgpd/pfkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkey.c,v 1.51 2017/08/21 14:43:33 phessler Exp $ */ +/* $OpenBSD: pfkey.c,v 1.52 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -458,7 +458,8 @@ pfkey_reply(int sd, u_int32_t *spi) return (-1); } } - if ((data = reallocarray(NULL, hdr.sadb_msg_len, PFKEY2_CHUNK)) == NULL) { + if ((data = reallocarray(NULL, hdr.sadb_msg_len, PFKEY2_CHUNK)) + == NULL) { log_warn("pfkey malloc"); return (-1); } diff --git a/usr.sbin/bgpd/pftable.c b/usr.sbin/bgpd/pftable.c index a46dd5db688..9766f1edfc3 100644 --- a/usr.sbin/bgpd/pftable.c +++ b/usr.sbin/bgpd/pftable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pftable.c,v 1.10 2017/01/24 04:22:42 benno Exp $ */ +/* $OpenBSD: pftable.c,v 1.11 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2004 Damien Miller @@ -258,4 +258,3 @@ pftable_commit(void) return (ret); } - diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 986e63cce8a..2f33bbbf7ad 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.423 2018/09/14 10:22:11 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.424 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -3702,7 +3702,7 @@ network_delete(struct network_config *nc, int flagstatic) } if (prefix_remove(&ribs[RIB_ADJ_IN].rib, peerself, &nc->prefix, nc->prefixlen)) - peerself->prefix_cnt--; + peerself->prefix_cnt--; } void diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index f344ba2f4fb..56425e0c9ca 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.191 2018/09/18 15:14:07 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.192 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker and @@ -295,7 +295,7 @@ struct rib_desc { struct rib_context ribctx; struct filter_head *in_rules; struct filter_head *in_rules_tmp; - enum reconf_action state; + enum reconf_action state; u_int8_t dumping; }; diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 6f7a94e2425..5b2b4688f03 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.109 2018/08/10 11:15:53 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.110 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -145,7 +145,7 @@ attr_hash_stats(struct rde_hashstats *hs) int64_t n; memset(hs, 0, sizeof(*hs)); - strlcpy(hs->name, "attr hash", sizeof(hs->name)); + strlcpy(hs->name, "attr hash", sizeof(hs->name)); hs->min = LLONG_MAX; hs->num = attrtable.hashmask + 1; @@ -494,7 +494,7 @@ aspath_hash_stats(struct rde_hashstats *hs) int64_t n; memset(hs, 0, sizeof(*hs)); - strlcpy(hs->name, "aspath hash", sizeof(hs->name)); + strlcpy(hs->name, "aspath hash", sizeof(hs->name)); hs->min = LLONG_MAX; hs->num = astable.hashmask + 1; @@ -938,7 +938,6 @@ aspath_lenmatch(struct aspath *a, enum aslen_spec type, u_int aslen) seg_len = seg[1]; seg_size = 2 + sizeof(u_int32_t) * seg_len; - for (i = 0; i < seg_len; i++) { as = aspath_extract(seg, i); if (as == lastas) { diff --git a/usr.sbin/bgpd/rde_filter.c b/usr.sbin/bgpd/rde_filter.c index 39db8a9cbf0..f1c53b6a613 100644 --- a/usr.sbin/bgpd/rde_filter.c +++ b/usr.sbin/bgpd/rde_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_filter.c,v 1.106 2018/09/09 14:08:11 benno Exp $ */ +/* $OpenBSD: rde_filter.c,v 1.107 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -98,8 +98,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, break; case ACTION_SET_RELATIVE_WEIGHT: if (set->action.relative > 0) { - if (set->action.relative + state->aspath.weight < - state->aspath.weight) + if (set->action.relative + state->aspath.weight + < state->aspath.weight) state->aspath.weight = UINT_MAX; else state->aspath.weight += @@ -145,7 +145,7 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.community.as) { case COMMUNITY_ERROR: case COMMUNITY_ANY: - fatalx("rde_apply_set bad community string"); + fatalx("%s: bad community string", __func__); case COMMUNITY_NEIGHBOR_AS: as = peer->conf.remote_as; break; @@ -160,7 +160,7 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.community.type) { case COMMUNITY_ERROR: case COMMUNITY_ANY: - fatalx("rde_apply_set bad community string"); + fatalx("%s: bad community string", __func__); case COMMUNITY_NEIGHBOR_AS: type = peer->conf.remote_as; break; @@ -177,7 +177,7 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, case ACTION_DEL_COMMUNITY: switch (set->action.community.as) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad community string"); + fatalx("%s: bad community string", __func__); case COMMUNITY_NEIGHBOR_AS: as = peer->conf.remote_as; break; @@ -192,7 +192,7 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.community.type) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad community string"); + fatalx("%s: bad community string", __func__); case COMMUNITY_NEIGHBOR_AS: type = peer->conf.remote_as; break; @@ -210,7 +210,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, case ACTION_SET_LARGE_COMMUNITY: switch (set->action.large_community.as) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad large community string"); + fatalx("%s: bad large community string", + __func__); case COMMUNITY_NEIGHBOR_AS: las = peer->conf.remote_as; break; @@ -225,7 +226,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.large_community.ld1) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad large community string"); + fatalx("%s: bad large community string", + __func__); case COMMUNITY_NEIGHBOR_AS: ld1 = peer->conf.remote_as; break; @@ -240,7 +242,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.large_community.ld2) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad large community string"); + fatalx("%s: bad large community string", + __func__); case COMMUNITY_NEIGHBOR_AS: ld2 = peer->conf.remote_as; break; @@ -258,7 +261,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, case ACTION_DEL_LARGE_COMMUNITY: switch (set->action.large_community.as) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad large community string"); + fatalx("%s: bad large community string", + __func__); case COMMUNITY_NEIGHBOR_AS: las = peer->conf.remote_as; break; @@ -273,7 +277,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.large_community.ld1) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad large community string"); + fatalx("%s: bad large community string", + __func__); case COMMUNITY_NEIGHBOR_AS: ld1 = peer->conf.remote_as; break; @@ -288,7 +293,8 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, switch (set->action.large_community.ld2) { case COMMUNITY_ERROR: - fatalx("rde_apply_set bad large community string"); + fatalx("%s: bad large community string", + __func__); case COMMUNITY_NEIGHBOR_AS: ld2 = peer->conf.remote_as; break; @@ -325,11 +331,13 @@ rde_apply_set(struct filter_set_head *sh, struct filterstate *state, state->aspath.origin = set->action.origin; break; case ACTION_SET_EXT_COMMUNITY: - community_ext_set(&state->aspath, &set->action.ext_community, + community_ext_set(&state->aspath, + &set->action.ext_community, peer->conf.remote_as); break; case ACTION_DEL_EXT_COMMUNITY: - community_ext_delete(&state->aspath, &set->action.ext_community, + community_ext_delete(&state->aspath, + &set->action.ext_community, peer->conf.remote_as); break; } @@ -1012,7 +1020,7 @@ rde_filter(struct filter_head *rules, struct rde_peer *peer, if (state && state->aspath.flags & F_ATTR_PARSE_ERR) /* - * don't try to filter bad updates just deny them + * don't try to filter bad updates just deny them * so they act as implicit withdraws */ return (ACTION_DENY); diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index 785af1ed7d6..18e5f7a0b34 100644 --- a/usr.sbin/bgpd/rde_rib.c +++ b/usr.sbin/bgpd/rde_rib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_rib.c,v 1.177 2018/09/17 17:06:33 sthen Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.178 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker @@ -242,7 +242,7 @@ rib_add(struct rib *rib, struct bgpd_addr *prefix, int prefixlen) re->prefix = pte; re->__rib = rib; - if (RB_INSERT(rib_tree, rib_tree(rib), re) != NULL) { + if (RB_INSERT(rib_tree, rib_tree(rib), re) != NULL) { log_warnx("rib_add: insert failed"); free(re); return (NULL); @@ -400,7 +400,7 @@ path_hash_stats(struct rde_hashstats *hs) int64_t n; memset(hs, 0, sizeof(*hs)); - strlcpy(hs->name, "path hash", sizeof(hs->name)); + strlcpy(hs->name, "path hash", sizeof(hs->name)); hs->min = LLONG_MAX; hs->num = pathtable.path_hashmask + 1; @@ -782,7 +782,7 @@ prefix_add(struct bgpd_addr *prefix, int prefixlen, struct rib *rib, prefix_nhflags(p) != state->nhflags) { /* prefix metadata changed therefor move */ return (prefix_move(p, peer, asp, state)); - } + } p->lastchange = time(NULL); return (0); } diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 65bee17c1d9..e106927a815 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.367 2018/09/19 13:09:30 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.368 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -2487,8 +2487,8 @@ parse_capabilities(struct peer *peer, u_char *d, u_int16_t dlen, u_int32_t *as) if (*as == 0) { log_peer_warnx(&peer->conf, "peer requests unacceptable AS %u", *as); - session_notification(peer, ERR_OPEN, ERR_OPEN_AS, - NULL, 0); + session_notification(peer, ERR_OPEN, + ERR_OPEN_AS, NULL, 0); change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN); return (-1); } @@ -2670,7 +2670,8 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx, u_int *listener_cnt) np->conf.id, &np->conf, sizeof(struct peer_config)) == -1) - fatalx("imsg_compose error"); + fatalx("imsg_compose" + " error"); } } } @@ -3272,7 +3273,8 @@ session_stop(struct peer *peer, u_int8_t subcode) communication = peer->conf.shutcomm; - if ((subcode == ERR_CEASE_ADMIN_DOWN || subcode == ERR_CEASE_ADMIN_RESET) + if ((subcode == ERR_CEASE_ADMIN_DOWN || + subcode == ERR_CEASE_ADMIN_RESET) && communication && *communication) { shutcomm_len = strlen(communication); if(shutcomm_len < SHUT_COMM_LEN) { diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 53841fde62c..aa2e20f8638 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.123 2017/05/28 12:21:36 claudio Exp $ */ +/* $OpenBSD: session.h,v 1.124 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -296,7 +296,7 @@ struct peer *getpeerbyaddr(struct bgpd_addr *); struct peer *getpeerbydesc(const char *); int imsg_ctl_parent(int, u_int32_t, pid_t, void *, u_int16_t); int imsg_ctl_rde(int, pid_t, void *, u_int16_t); -void session_stop(struct peer *, u_int8_t); +void session_stop(struct peer *, u_int8_t); /* timer.c */ time_t getmonotime(void); diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c index c60c7241351..bc2b9b840ff 100644 --- a/usr.sbin/bgpd/util.c +++ b/usr.sbin/bgpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.37 2018/09/20 07:41:25 claudio Exp $ */ +/* $OpenBSD: util.c,v 1.38 2018/09/20 11:06:04 benno Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -338,11 +338,11 @@ as_compare(struct filter_as *f, u_int32_t as, u_int32_t neighas) return (1); break; case OP_RANGE: - if (as >= f->as_min && as <= f->as_max) + if (as >= f->as_min && as <= f->as_max) return (1); break; case OP_XRANGE: - if (as < f->as_min || as > f->as_max) + if (as < f->as_min || as > f->as_max) return (1); break; }