Skip to content

Instantly share code, notes, and snippets.

@polychaeta
Created February 23, 2021 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polychaeta/6256c648df991f5d40ef10e61f8bc725 to your computer and use it in GitHub Desktop.
Save polychaeta/6256c648df991f5d40ef10e61f8bc725 to your computer and use it in GitHub Desktop.
FRRouting/frr #8138
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 89a3d5f7d..f7f986391 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -718,8 +718,8 @@ static int ospf6_link_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
|| current + OSPF6_PREFIX_SIZE(prefix) > end)
break;
- ospf6_prefix_options_printbuf(prefix->prefix_options,
- buf, sizeof(buf));
+ ospf6_prefix_options_printbuf(prefix->prefix_options, buf,
+ sizeof(buf));
if (use_json) {
json_loop = json_object_new_object();
json_object_string_add(json_loop, "prefixOption", buf);
@@ -942,8 +942,8 @@ static int ospf6_intra_prefix_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
|| current + OSPF6_PREFIX_SIZE(prefix) > end)
break;
- ospf6_prefix_options_printbuf(prefix->prefix_options,
- buf, sizeof(buf));
+ ospf6_prefix_options_printbuf(prefix->prefix_options, buf,
+ sizeof(buf));
if (use_json) {
json_loop = json_object_new_object();
json_object_string_add(json_loop, "prefixOption", buf);
diff --git a/ospf6d/ospf6_proto.c b/ospf6d/ospf6_proto.c
index 839017b19..e60d2c7e0 100644
--- a/ospf6d/ospf6_proto.c
+++ b/ospf6d/ospf6_proto.c
@@ -62,21 +62,11 @@ void ospf6_prefix_options_printbuf(uint8_t prefix_options, char *buf, int size)
{
const char *dn, *p, *mc, *la, *nu;
- dn = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_DN)
- ? "DN"
- : "--");
- p = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_P)
- ? "P"
- : "--");
- mc = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_MC)
- ? "MC"
- : "--");
- la = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_LA)
- ? "LA"
- : "--");
- nu = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_NU)
- ? "NU"
- : "--");
+ dn = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_DN) ? "DN" : "--");
+ p = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_P) ? "P" : "--");
+ mc = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_MC) ? "MC" : "--");
+ la = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_LA) ? "LA" : "--");
+ nu = (CHECK_FLAG(prefix_options, OSPF6_PREFIX_OPTION_NU) ? "NU" : "--");
snprintf(buf, size, "%s|%s|%s|%s|%s", dn, p, mc, la, nu);
}
diff --git a/ospf6d/ospf6_proto.h b/ospf6d/ospf6_proto.h
index dcc8627ae..da6b270e0 100644
--- a/ospf6d/ospf6_proto.h
+++ b/ospf6d/ospf6_proto.h
@@ -69,7 +69,8 @@ struct ospf6_prefix {
#define OSPF6_PREFIX_OPTION_LA (1 << 1) /* Local Address */
#define OSPF6_PREFIX_OPTION_MC (1 << 2) /* MultiCast */
#define OSPF6_PREFIX_OPTION_P (1 << 3) /* Propagate (NSSA) */
-#define OSPF6_PREFIX_OPTION_DN (1 << 4) /* DN bit to prevent loops in VPN environment */
+#define OSPF6_PREFIX_OPTION_DN \
+ (1 << 4) /* DN bit to prevent loops in VPN environment */
/* caddr_t OSPF6_PREFIX_BODY (struct ospf6_prefix *); */
#define OSPF6_PREFIX_BODY(x) ((caddr_t)(x) + sizeof(struct ospf6_prefix))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment