]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tos_sip option was not being set correctly
authorDavid Vossel <dvossel@digium.com>
Thu, 19 Aug 2010 21:03:24 +0000 (21:03 +0000)
committerDavid Vossel <dvossel@digium.com>
Thu, 19 Aug 2010 21:03:24 +0000 (21:03 +0000)
When tos_sip is used, the tos of the sip socket is only set
correctly if the socket binding changes on a reload.  If the binding
stays the same but the TOS changes, the new tos value would not take
into effect.  This patch fixes that.

(closes issue #17712)
Reported by: nickb

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@282893 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 02ac5002d61026d648defaf6b7b3da0176d73909..a7edd8a255495a8e6f862248a1337d1b790a81af 100644 (file)
@@ -18916,6 +18916,8 @@ static int reload_config(enum channelreloadreason reason)
                                        ast_log(LOG_WARNING, "Unable to set SIP TOS to %s\n", ast_tos2str(global_tos_sip));
                        }
                }
+       } else if (setsockopt(sipsock, IPPROTO_IP, IP_TOS, &global_tos_sip, sizeof(global_tos_sip))) {
+               ast_log(LOG_WARNING, "Unable to set SIP TOS to %s\n", ast_tos2str(global_tos_sip));
        }
        ast_mutex_unlock(&netlock);