aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_introspect.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-12-31 15:40:49 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-31 15:40:49 (GMT)
commit6fc74e518141467ab9c629aee2061cb149250535 (patch)
treefac8099ab23fc6b704dc3c99b9f769b90c654def /wpa_supplicant/dbus/dbus_new_introspect.c
parentd033694ac571eadc934911767d03bbe1a34b3cb0 (diff)
downloadhostap-6fc74e518141467ab9c629aee2061cb149250535.zip
hostap-6fc74e518141467ab9c629aee2061cb149250535.tar.gz
hostap-6fc74e518141467ab9c629aee2061cb149250535.tar.bz2
dbus: Increase buffer size to fix Introspect XML
Commit e9c3c1afedd2d0c6a0939f40c40701af8c450e1f added a new D-Bus method and that was enough to push the Introspect XML buffer over the previously allocated 8000 bytes. Increase the buffer size to make enough room for P2P interface. In addition, add a debug message to indicate if an XML segment does not fit into the buffer to make this types of failures somewhat easier to catch. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_introspect.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_introspect.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_introspect.c b/wpa_supplicant/dbus/dbus_new_introspect.c
index fb29f20..d443269 100644
--- a/wpa_supplicant/dbus/dbus_new_introspect.c
+++ b/wpa_supplicant/dbus/dbus_new_introspect.c
@@ -164,6 +164,12 @@ static void add_interfaces(struct dl_list *list, struct wpabuf *xml)
if (wpabuf_len(iface->xml) + 20 < wpabuf_tailroom(xml)) {
wpabuf_put_buf(xml, iface->xml);
wpabuf_put_str(xml, "</interface>");
+ } else {
+ wpa_printf(MSG_DEBUG, "dbus: Not enough room for "
+ "add_interfaces inspect data: tailroom %u, "
+ "add %u",
+ (unsigned int) wpabuf_tailroom(xml),
+ (unsigned int) wpabuf_len(iface->xml));
}
dl_list_del(&iface->list);
wpabuf_free(iface->xml);
@@ -251,7 +257,7 @@ DBusMessage * wpa_dbus_introspect(DBusMessage *message,
DBusMessage *reply;
struct wpabuf *xml;
- xml = wpabuf_alloc(8000);
+ xml = wpabuf_alloc(10000);
if (xml == NULL)
return NULL;