Remove gateway object from /api/ftl/interfaces

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2022-12-31 13:22:02 +01:00
parent e776e0290a
commit 393792b606
2 changed files with 1 additions and 7 deletions
+1 -1
View File
@@ -146,5 +146,5 @@ static int api_endpoints(struct ftl_conn *api)
JSON_ADD_ITEM_TO_OBJECT(json, "endpoints", endpoints);
// Send response
JSON_SEND_OBJECT_UNLOCK(json);
JSON_SEND_OBJECT(json);
}
-6
View File
@@ -794,7 +794,6 @@ static int json_iface(struct ftl_conn *api, struct if_info *iface, cJSON *json)
int api_ftl_interfaces(struct ftl_conn *api)
{
cJSON *json = JSON_NEW_OBJECT();
cJSON *gateway = JSON_NEW_OBJECT();
cJSON *interfaces = JSON_NEW_ARRAY();
// Get interface with default route
@@ -802,11 +801,6 @@ int api_ftl_interfaces(struct ftl_conn *api)
char default_iface[IF_NAMESIZE] = { 0 };
getDefaultInterface(default_iface, &gw);
const char *gwaddr = inet_ntoa(*(struct in_addr *) &gw);
JSON_COPY_STR_TO_OBJECT(gateway, "address", gwaddr);
JSON_REF_STR_IN_OBJECT(gateway, "interface", default_iface);
JSON_ADD_ITEM_TO_OBJECT(json, "gateway", gateway);
// Enumerate and list interfaces
struct if_info *ifinfo = NULL;
if(!listInterfaces(&ifinfo, default_iface))