Module: sems Branch: master Commit: 062dc15197741419a60ea958c158b4cf621c7ba9 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=062dc15197741419a60ea958c158b4cf621c7ba9
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Thu May 23 14:07:20 2013 +0200 sip: drop messages without a valid source port. --- core/sip/udp_trsp.cpp | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/core/sip/udp_trsp.cpp b/core/sip/udp_trsp.cpp index df40808..2196ff1 100644 --- a/core/sip/udp_trsp.cpp +++ b/core/sip/udp_trsp.cpp @@ -320,6 +320,13 @@ void udp_trsp::run() ERROR("Message was too big (>%d)\n",MAX_UDP_MSGLEN); continue; } + + sockaddr_storage* sa = (sockaddr_storage*)msg.msg_name; + if(!am_get_port(sa)) { + DBG("Source port is 0: dropping"); + continue; + } + sip_msg* s_msg = new sip_msg(buf,buf_len); memcpy(&s_msg->remote_ip,msg.msg_name,msg.msg_namelen); _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
