[ 
https://issues.apache.org/jira/browse/TS-2995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14103817#comment-14103817
 ] 

ASF subversion and git services commented on TS-2995:
-----------------------------------------------------

Commit cde870b312e5f08a787ba8512bfcc7b34853c569 in trafficserver's branch 
refs/heads/master from [~nottheoilrig]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=cde870b ]

TS-2995: Apply TOS/SO marks to client connection in all accept cases.


> Setting client response TOS/DSCP field has no effect
> ----------------------------------------------------
>
>                 Key: TS-2995
>                 URL: https://issues.apache.org/jira/browse/TS-2995
>             Project: Traffic Server
>          Issue Type: Bug
>            Reporter: Jack Bates
>            Assignee: Jack Bates
>             Fix For: 5.1.0
>
>
> {{proxy.config.net.sock_packet_tos_in}} has no effect if 
> {{proxy.config.accept_threads}} is not zero.
> If it is zero then {{UnixNetProcessor::accept_internal()}} calls 
> {{NetAccept::init_accept_per_thread()}} which eventually calls 
> {{NetAccept::acceptFastEvent()}} in which there's code to set the {{SO_MARK}} 
> and {{IP_TOS}} socket options.
> But if it's not zero then {{UnixNetProcessor::accept_internal()}} instead 
> calls {{NetAccept::init_accept_loop()}} which eventually calls 
> {{NetAccept::do_blocking_accept()}}
> One fix is to copy the code to set the {{SO_MARK}} and {{IP_TOS}} socket 
> options from {{NetAccept::acceptFastEvent()}} to 
> {{NetAccept::do_blocking_accept()}}
> {code}
> --- a/iocore/net/UnixNetAccept.cc
> +++ b/iocore/net/UnixNetAccept.cc
> @@ -275,6 +275,18 @@ NetAccept::do_blocking_accept(EThread * t)
>        return -1;
>      }
>  
> +#if TS_HAS_SO_MARK
> +      if (packet_mark != 0) {
> +        safe_setsockopt(con.fd, SOL_SOCKET, SO_MARK, reinterpret_cast<char 
> *>(&
> +      }
> +#endif
> +
> +#if TS_HAS_IP_TOS
> +      if (packet_tos != 0) {
> +        safe_setsockopt(con.fd, IPPROTO_IP, IP_TOS, reinterpret_cast<char 
> *>(&p
> +      }
> +#endif
> +
>      // Use 'NULL' to Bypass thread allocator
>      vc = (UnixNetVConnection *)this->getNetProcessor()->allocate_vc(NULL);
>      if (!vc) {
> {code}
> I tested this change and verified that 
> {{proxy.config.net.sock_packet_tos_in}} does correctly set the TOS/DSCP field.
> This issue was reported by Jason Strongman on the users list 
> http://thread.gmane.org/gmane.comp.apache.trafficserver.user/4141/focus=4202
> {{proxy.config.net.sock_packet_tos_in}} was introduced in TS-1090 and commit 
> b77838991531d6cb402618c3d690b83e95b92d63



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to