-/* $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>
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);
}
-/* $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>
return (ret);
}
-
-/* $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>
}
if (prefix_remove(&ribs[RIB_ADJ_IN].rib, peerself, &nc->prefix,
nc->prefixlen))
- peerself->prefix_cnt--;
+ peerself->prefix_cnt--;
}
void
-/* $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
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;
};
-/* $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>
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;
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;
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) {
-/* $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>
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 +=
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
}
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);
-/* $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>
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);
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;
prefix_nhflags(p) != state->nhflags) {
/* prefix metadata changed therefor move */
return (prefix_move(p, peer, asp, state));
- }
+ }
p->lastchange = time(NULL);
return (0);
}
-/* $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>
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);
}
np->conf.id, &np->conf,
sizeof(struct peer_config))
== -1)
- fatalx("imsg_compose error");
+ fatalx("imsg_compose"
+ " error");
}
}
}
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) {
-/* $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>
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);
-/* $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>
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;
}