-/* $OpenBSD: bgpctl.c,v 1.294 2023/04/23 11:39:51 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.295 2023/04/28 13:24:25 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
complen = PREFIX_SIZE(len) + 1;
data = &addr->v6;
break;
+ default:
+ errx(1, "unsupported address family for flowspec address");
}
comp = malloc(complen);
if (comp == NULL)
-/* $OpenBSD: output.c,v 1.40 2023/04/21 10:49:01 claudio Exp $ */
+/* $OpenBSD: output.c,v 1.41 2023/04/28 13:24:25 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
const char *fmt, *flags;
int complen, off = 0;
- if (flowspec_get_component(f->data, f->len, type, is_v6,
- &comp, &complen) != 1)
- return;
-
- printf("%s ", flowspec_fmt_label(type));
-
switch (type) {
case FLOWSPEC_TYPE_TCP_FLAGS:
flags = FLOWSPEC_TCP_FLAG_STRING;
else
flags = FLOWSPEC_FRAG_STRING6;
break;
+ default:
+ printf("??? ");
+ return;
}
+ if (flowspec_get_component(f->data, f->len, type, is_v6,
+ &comp, &complen) != 1)
+ return;
+
+ printf("%s ", flowspec_fmt_label(type));
+
fmt = flowspec_fmt_bin_op(comp, complen, &off, flags);
if (off == -1) {
printf("%s ", fmt);