Re: Modified TOS marking code

From: Lizzy Dizzy <lizzy_99@dont-contact.us>
Date: Wed, 28 Apr 2004 01:23:11 +0000

Hi Henrik,

I've tested out the code and it works fine. Return traffic to users gets
tagged to either 0x80 (MISS*) or 0x40 (all other code). However, running a
tcpdump I notice that some traffic from squid to users are not tagged
(labelled **). I am quite puzzled why it is so, considering that the switch
statement I used has a default clause in it. And also, from the dump, it is
clear that squid is the one replying the user.

Thanks.
Liz

15:02:40.310969 test9.abc.net.squid > spoffs96-166.abc.net.sg.3709: . ack
2014 win 10217 (DF) [tos 0x80]
15:02:40.315549 test9.abc.net.squid > spoffs96-166.abc.net.sg.3709: P
9235:9760(525) ack 2014 win 10217 (DF) [tos 0x80]
15:02:40.315758 test9.abc.net.squid > spoffs96-166.abc.net.sg.3709: F
9760:9760(0) ack 2014 win 10217 (DF) [tos 0x80]
15:02:40.316850 spoffs96-166.abc.net.sg.3709 > test9.abc.net.squid: . ack
9761 win 63715 (DF)
15:02:40.327058 spoffs96-166.abc.net.sg.3709 > test9.abc.net.squid: F
2014:2014(0) ack 9761 win 63715 (DF)
**15:02:40.327073 test9.abc.net.squid > spoffs96-166.abc.net.sg.3709: . ack
2015 win 10217 (DF)
15:02:40.357688 spoffs96-166.abc.net.sg.3713 > test9.abc.net.squid: S
3763417607:3763417607(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
**15:02:40.357710 test9.abc.net.squid > spoffs96-166.abc.net.sg.3713: S
3042739657:3042739657(0) ack 3763417608 win 5840 <mss 1460,nop,nop,sackOK>
(DF)

>From: Henrik Nordstrom <hno@squid-cache.org>
>To: Lizzy Dizzy <lizzy_99@hotmail.com>
>CC: squid-dev@squid-cache.org, <hno@squid-cache.org>
>Subject: Re: Modified TOS marking code!
>Date: Thu, 22 Apr 2004 12:35:09 +0200 (CEST)
>
>On Thu, 22 Apr 2004, Lizzy Dizzy wrote:
>
> > Does the code looks right? Can I put the code under the "if
> > (http->out.offset == 0)" condition?
>
>Looks fine.
>
>Note: the enter/leave_suid calls should not be needed. Not sure why these
>are there, probably leftovers from an earlier incarnation of the patch
>where a custom IP option was used.
>
>Regards
>Henrik
>

/* <---- TOS Patch !!! ----> */
int tos = 0;
switch ( http->log_type )
{
        case LOG_TCP_MISS:
        case LOG_TCP_REFRESH_MISS:
        case LOG_TCP_CLIENT_REFRESH_MISS:
        case LOG_TCP_SWAPFAIL_MISS:
                tos = 128; /* [tos 0x80] */
                break;
        default:
                tos = 64; /* [tos 0x40] */
                break;
}

if (setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0) {
        debug(50, 1) ("TOS Patch: setsockopt(IP_TOS) on FD %d: %s\n", fd,
xstrerror());
}

_________________________________________________________________
Find it on the web with MSN Search. http://search.msn.com.sg/
Received on Tue Apr 27 2004 - 19:23:13 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Apr 29 2004 - 12:00:03 MDT