whitespace cleanup, ok claudio@
authorbenno <benno@openbsd.org>
Thu, 20 Sep 2018 11:06:04 +0000 (11:06 +0000)
committerbenno <benno@openbsd.org>
Thu, 20 Sep 2018 11:06:04 +0000 (11:06 +0000)
usr.sbin/bgpd/pfkey.c
usr.sbin/bgpd/pftable.c
usr.sbin/bgpd/rde.c
usr.sbin/bgpd/rde.h
usr.sbin/bgpd/rde_attr.c
usr.sbin/bgpd/rde_filter.c
usr.sbin/bgpd/rde_rib.c
usr.sbin/bgpd/session.c
usr.sbin/bgpd/session.h
usr.sbin/bgpd/util.c

index 0092358..509af57 100644 (file)
@@ -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 <henning@openbsd.org>
@@ -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);
        }
index a46dd5d..9766f1e 100644 (file)
@@ -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 <djm@openbsd.org>
@@ -258,4 +258,3 @@ pftable_commit(void)
 
        return (ret);
 }
-
index 986e63c..2f33bbb 100644 (file)
@@ -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 <henning@openbsd.org>
@@ -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
index f344ba2..56425e0 100644 (file)
@@ -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 <claudio@openbsd.org> 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;
 };
 
index 6f7a94e..5b2b468 100644 (file)
@@ -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 <claudio@openbsd.org>
@@ -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) {
index 39db8a9..f1c53b6 100644 (file)
@@ -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 <claudio@openbsd.org>
@@ -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);
index 785af1e..18e5f7a 100644 (file)
@@ -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 <claudio@openbsd.org>
@@ -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);
        }
index 65bee17..e106927 100644 (file)
@@ -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 <henning@openbsd.org>
@@ -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) {
index 53841fd..aa2e20f 100644 (file)
@@ -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 <henning@openbsd.org>
@@ -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);
index c60c724..bc2b9b8 100644 (file)
@@ -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 <claudio@openbsd.org>
@@ -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;
        }