mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Remove gateway object from /api/ftl/interfaces
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user