From 755470287207c4b580b722536889a8bb9d9427bf Mon Sep 17 00:00:00 2001 From: dequis Date: Wed, 25 Nov 2015 12:56:09 -0300 Subject: jabber: Reply unknown IQs with service-unavailable instead It was sending 'feature-not-implemented' for with unknown xmlns (which makes sense, but the RFC says that's wrong. idk.) and nothing at all for IQs that don't have query/ping/time elements or an xmlns attribute. Both get service-unavailable now. Addresses the rest of trac ticket 533: https://bugs.bitlbee.org/bitlbee/ticket/533 --- protocols/jabber/iq.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c index d5ed8f21..8175f139 100644 --- a/protocols/jabber/iq.c +++ b/protocols/jabber/iq.c @@ -52,9 +52,11 @@ xt_status jabber_pkt_iq(struct xt_node *node, gpointer data) (c = xt_find_node(node->children, "ping")) || (c = xt_find_node(node->children, "time"))) || !(s = xt_find_attr(c, "xmlns"))) { - /* Sigh. Who decided to suddenly invent new elements - instead of just sticking with ? */ - return XT_HANDLED; + + reply = jabber_make_error_packet(node, "service-unavailable", "cancel", NULL); + st = jabber_write_packet(ic, reply); + xt_free_node(reply); + return st; } reply = xt_new_node("query", NULL, NULL); @@ -135,7 +137,7 @@ xt_status jabber_pkt_iq(struct xt_node *node, gpointer data) } } else { xt_free_node(reply); - reply = jabber_make_error_packet(node, "feature-not-implemented", "cancel", NULL); + reply = jabber_make_error_packet(node, "service-unavailable", "cancel", NULL); pack = 0; } } else if (strcmp(type, "set") == 0) { -- cgit v1.2.3