Hi Netdev,

Any help, much appreciated.

-Roobesh G M

From: Mohandass, Roobesh 
Sent: Monday, December 31, 2018 1:13 PM
To: netdev@vger.kernel.org
Cc: Willy Tarreau <w...@1wt.eu>
Subject: RE: [NETDEV]: getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, sa, &salen) is 
in fact sometimes returning the source IP instead the destination IP

(email is bouncing due to URL in the body of the message and my signature 
adjusted, so using hash instead).

Hi Netdev,

Issue: getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, sa, &salen) is in fact sometimes 
returning the source IP instead the destination IP

Using below version of,
~# lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04

What you expected to happen:
getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, sa, &salen) - should return always 
destination IP(connected IP).

What happened instead:
getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, sa, &salen) is in fact sometimes 
returning the source IP instead the destination IP. Using getsockname() instead 
looks like solving the issue.

For just an example: 
Out of 6569124 requests , 4 requests were wrong 0.000060891 % (this is just an 
rough estimate to give you idea on frequency)

Some old reference: (similar behavior observed) 
Base64 encode: 
aHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMTE0MTcxODcvZ2V0c29ja29wdC1zby1vcmlnaW5hbC1kc3Qtb2NjYXNpb25hbGx5LXJldHVybnMtY2xpZW50LWFkZHJlc3M=
(use above to convert URL for reference).

Side Note: (about how we identified this behavior)
We were using haproxy-version 1.8.14-1 which is using this kernel function 
getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, sa, &salen) to get the destination IP 
details/connected address details. But instead we are getting very occasional 
source IP address instead of destination(Connected IP).

Thanks for your attention on this message.

With kind regards,
RGM(Roobesh Mohandass)
Cloud Security Platform

Reply via email to