Re: Query: Respond with same tos/dscp value as incoming request tos/dscp value

2019-10-08 Thread Willy Tarreau
Hi Nikhil,

On Tue, Oct 08, 2019 at 04:09:49PM +0530, Nikhil Agrawal wrote:
> Hi,
> 
> I have a use case where i need http response from haproxy with same
> tos/dscp value as incoming packet.
> 
> I found the set-tos in haproxy but no option to dynamically set the same as
> incoming request.
> 
> Is there any way to do the same in haproxy.

No indeed we do not have this in the other way around. I suggest you
try to experiment a bit with getsockopt(IP_TOS) to see what is
reported. Indeed, I don't know what the kernel will report, if it is
the last known TOS for a connection, the first one seen on the SYN
packet or anything else. If you figure we can get any useful information
then I think it makes sense to slightly modify the set-tos action so
that in addition to taking a numeric value it also accepts an expression.

In this case we could have fc_tos() and bc_tos() to get the TOS field
from either the front or the back connection, and use it in set-tos
to adjust the TOS in responses to the client.

Given that it's not something critical I'm fine with getting this
merged at the last minute before the 2.1 release if needed.

Willy



Query: Respond with same tos/dscp value as incoming request tos/dscp value

2019-10-08 Thread Nikhil Agrawal
Hi,

I have a use case where i need http response from haproxy with same
tos/dscp value as incoming packet.

I found the set-tos in haproxy but no option to dynamically set the same as
incoming request.

Is there any way to do the same in haproxy.

Thanks in advance.

Regards,
Nikhil Agrawal

-- 



*-*


*This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error, please notify the 
system manager. This message contains confidential information and is 
intended only for the individual named. If you are not the named addressee, 
you should not disseminate, distribute or copy this email. Please notify 
the sender immediately by email if you have received this email by mistake 
and delete this email from your system. If you are not the intended 
recipient, you are notified that disclosing, copying, distributing or 
taking any action in reliance on the contents of this information is 
strictly prohibited.*

 

*Any views or opinions presented in this 
email are solely those of the author and do not necessarily represent those 
of the organization. Any information on shares, debentures or similar 
instruments, recommended product pricing, valuations and the like are for 
information purposes only. It is not meant to be an instruction or 
recommendation, as the case may be, to buy or to sell securities, products, 
services nor an offer to buy or sell securities, products or services 
unless specifically stated to be so on behalf of the Flipkart group. 
Employees of the Flipkart group of companies are expressly required not to 
make defamatory statements and not to infringe or authorise any 
infringement of copyright or any other legal right by email communications. 
Any such communication is contrary to organizational policy and outside the 
scope of the employment of the individual concerned. The organization will 
not accept any liability in respect of such communication, and the employee 
responsible will be personally liable for any damages or other liability 
arising.*

 

*Our organization accepts no liability for the 
content of this email, or for the consequences of any actions taken on the 
basis of the information *provided,* unless that information is 
subsequently confirmed in writing. If you are not the intended recipient, 
you are notified that disclosing, copying, distributing or taking any 
action in reliance on the contents of this information is strictly 
prohibited.*


_-_