summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_gr.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-07-12 09:29:06 -0300
committerRenato Westphal <renato@opensourcerouting.org>2021-09-16 12:26:48 -0300
commitb275f44a4a7f5338d8dd6cb2baf80b61b549913e (patch)
tree33c9cb8158e1be58345a4051cd2a475c4b14e713 /ospf6d/ospf6_gr.c
parentb1c1004fb93b63a0a4502e35966cf9bd6cf0166a (diff)
ospf6d: fix build problem with ancient json-c versions
Some CI VMs are using really old versions of json-c (pre 2013 [1]) that expect filenames to be passed as "char *" instead of "const char *". Add some explicit casts to fix the resulting compiler errors on those VMs (passing "char *" when the API expects "const char *" is fine). Hopefully this commit should be reverted once the CI is updated to use newer versions of json-c. [1] https://github.com/json-c/json-c/commit/20e4708c Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_gr.c')
-rw-r--r--ospf6d/ospf6_gr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ospf6d/ospf6_gr.c b/ospf6d/ospf6_gr.c
index c1d345d541..40893ed998 100644
--- a/ospf6d/ospf6_gr.c
+++ b/ospf6d/ospf6_gr.c
@@ -478,7 +478,7 @@ static void ospf6_gr_nvm_update(struct ospf6 *ospf6)
inst_name = ospf6->name ? ospf6->name : VRF_DEFAULT_NAME;
- json = json_object_from_file(OSPF6D_GR_STATE);
+ json = json_object_from_file((char *)OSPF6D_GR_STATE);
if (json == NULL)
json = json_object_new_object();
@@ -506,7 +506,8 @@ static void ospf6_gr_nvm_update(struct ospf6 *ospf6)
json_object_int_add(json_instance, "timestamp",
time(NULL) + ospf6->gr_info.grace_period);
- json_object_to_file_ext(OSPF6D_GR_STATE, json, JSON_C_TO_STRING_PRETTY);
+ json_object_to_file_ext((char *)OSPF6D_GR_STATE, json,
+ JSON_C_TO_STRING_PRETTY);
json_object_free(json);
}
@@ -522,7 +523,7 @@ static void ospf6_gr_nvm_delete(struct ospf6 *ospf6)
inst_name = ospf6->name ? ospf6->name : VRF_DEFAULT_NAME;
- json = json_object_from_file(OSPF6D_GR_STATE);
+ json = json_object_from_file((char *)OSPF6D_GR_STATE);
if (json == NULL)
json = json_object_new_object();
@@ -534,7 +535,8 @@ static void ospf6_gr_nvm_delete(struct ospf6 *ospf6)
json_object_object_del(json_instances, inst_name);
- json_object_to_file_ext(OSPF6D_GR_STATE, json, JSON_C_TO_STRING_PRETTY);
+ json_object_to_file_ext((char *)OSPF6D_GR_STATE, json,
+ JSON_C_TO_STRING_PRETTY);
json_object_free(json);
}
@@ -553,7 +555,7 @@ void ospf6_gr_nvm_read(struct ospf6 *ospf6)
inst_name = ospf6->name ? ospf6->name : VRF_DEFAULT_NAME;
- json = json_object_from_file(OSPF6D_GR_STATE);
+ json = json_object_from_file((char *)OSPF6D_GR_STATE);
if (json == NULL)
json = json_object_new_object();
@@ -597,7 +599,8 @@ void ospf6_gr_nvm_read(struct ospf6 *ospf6)
json_object_object_del(json_instances, inst_name);
- json_object_to_file_ext(OSPF6D_GR_STATE, json, JSON_C_TO_STRING_PRETTY);
+ json_object_to_file_ext((char *)OSPF6D_GR_STATE, json,
+ JSON_C_TO_STRING_PRETTY);
json_object_free(json);
}