[Home]

Summary:ASTERISK-04797: ToS can't be set properly
Reporter:Roy Sigurd Karlsbakk (rkarlsba)Labels:
Date Opened:2005-08-09 06:30:26Date Closed:2008-01-15 15:44:11.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) siptosfix.patch
( 1) sip-tos-new.patch
Description:ToS can't be set with hex in sip.conf.....
with this patch it can be set with octal, if you want to :)
Comments:By: Roy Sigurd Karlsbakk (rkarlsba) 2005-08-09 07:05:55

new patch allows setting tos = 0 or 0x0

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-08-09 07:11:38

and for one that noted 'why only octal', you can, of course set it using hex as well :)

By: Vahan Yerkanian (vahan) 2005-08-09 08:06:01

just patched my cvs-head with your patch, here is the relevant output from asterisk -cvvvvvvvvv (with tos=lowdelay in sip.conf)

 == Parsing '/raid/etc/asterisk/sip.conf': Found
 == SIP Listening on 195.250.77.70:5060
 == Using TOS bits 16

and with tos=0x18

 == Parsing '/raid/etc/asterisk/sip.conf': Found
 == SIP Listening on 195.250.77.70:5060
 == Using TOS bits 0

and with tos=184

 == Parsing '/raid/etc/asterisk/sip.conf': Found
 == SIP Listening on 195.250.77.70:5060
 == Using TOS bits 184

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-08-09 08:09:56

you can check it with tcpdump -v udp as well :)
works well

By: Vahan Yerkanian (vahan) 2005-08-09 08:15:02

my sip.conf
-----------
tos=0x18

my tcpdump
----------

18:17:13.217069 IP (tos 0x0, ttl  64, id 63656, offset 0, flags [none], length: 60) sip.arminco.com.18896 > host-195-250-77-71.customer.arminco.com.24794: [bad udp cksum d2f6!] UDP, length: 32

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-08-09 08:20:13

did you remember to reload?
if i change tos in sip.conf and reload, it works for me.

By: Vahan Yerkanian (vahan) 2005-08-09 08:23:25

I stand corrected, reload didn't work for me, had to restart asterisk itself. Now I see proper tos on tcpdump, however, all packets seem to have wrong udp checksum - not sure how major is this tho. Thanks.

18:23:47.103865 IP (tos 0x18, ttl  64, id 7400, offset 0, flags [none], length: 60) sip.arminco.com.13964 > phoenix.arminco.com.6092: [bad udp cksum fd98!] UDP, length: 32
18:23:47.123394 IP (tos 0x0, ttl 126, id 42003, offset 0, flags [none], length: 60) phoenix.arminco.com.6092 > sip.arminco.com.13964: [udp sum ok] UDP, length: 32
18:23:47.123756 IP (tos 0x18, ttl  64, id 7402, offset 0, flags [none], length: 60) sip.arminco.com.13964 > phoenix.arminco.com.6092: [bad udp cksum ce55!] UDP, length: 32
18:23:47.144011 IP (tos 0x0, ttl 126, id 42004, offset 0, flags [none], length: 60) phoenix.arminco.com.6092 > sip.arminco.com.13964: [udp sum ok] UDP, length: 32
18:23:47.144383 IP (tos 0x18, ttl  64, id 7404, offset 0, flags [none], length: 60) sip.arminco.com.13964 > phoenix.arminco.com.6092: [bad udp cksum 75ed!] UDP, length: 32

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-08-09 08:29:08

wierd
no checksum errors here......

By: Vahan Yerkanian (vahan) 2005-08-09 10:07:53

confirming that this patch fixed the problem, but I still see udp checksum errors on my side.

By: Russell Bryant (russell) 2005-08-09 10:31:22

The format string to sscanf was improperly changed to %d from %i.  All we have to do to fix this is to change it back.

Patch uploaded.  Disclaimer on file.

By: Vahan Yerkanian (vahan) 2005-08-09 10:42:01

siptosfix.patch does the job too, confirmed :)

By: Roy Sigurd Karlsbakk (rkarlsba) 2005-08-09 11:01:09

I still find strtoul() a better way to do this, but then, that's my opinion....

By: Mark Spencer (markster) 2005-08-09 12:16:55

Fixed in CVS head.  Thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:44:10.000-0600

Repository: asterisk
Revision: 6314

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r6314 | markster | 2008-01-15 15:44:10 -0600 (Tue, 15 Jan 2008) | 2 lines

Allow ToS to be set in hex (bug ASTERISK-4797)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=6314