Ver código fonte

registrar: Prevent incorrect application of path when forwarding a register

- Reset the internal path pointer after a save() to prevent it being added
  as a Route: header, e.g. when running t_replicate()

(cherry picked from commit 61a1eee4fe2b7e3a7c6a8f82c86ac52957439053)
(cherry picked from commit 7d31ee740c49034f83192feffdcba2f7b8601fab)
(cherry picked from commit 8114b10c595f085721434dcd86a0e4b0bd28af57)
Hugh Waite 11 anos atrás
pai
commit
ab5025f934
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      modules/registrar/save.c

+ 3 - 0
modules/registrar/save.c

@@ -887,6 +887,9 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
 	if ((is_route_type(REQUEST_ROUTE)) && !is_cflag_set(REG_SAVE_NORPL_FL) && (reg_send_reply(_m) < 0))
 		return -1;
 
+	if (path_enabled && path_mode != PATH_MODE_OFF) {
+		reset_path_vector(_m);
+	}
 	return ret;
 error:
 	update_stat(rejected_registrations, 1);