diff options
| author | dequis <dx@dxzone.com.ar> | 2015-11-25 12:56:09 -0300 | 
|---|---|---|
| committer | dequis <dx@dxzone.com.ar> | 2015-11-25 12:56:09 -0300 | 
| commit | 755470287207c4b580b722536889a8bb9d9427bf (patch) | |
| tree | 03bcd3e16204701eef3453b1d2f0815f534f7bbf /protocols | |
| parent | 5b01e1a5b69d9a86833dcd54046fe6a7832efec8 (diff) | |
jabber: Reply unknown IQs with service-unavailable instead
It was sending 'feature-not-implemented' for <query> 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
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/jabber/iq.c | 10 | 
1 files changed, 6 insertions, 4 deletions
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 <query/>? */ -			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) {  | 
