Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4747 closed defect (fixed)

getsockname in connection_handle_listener_read should be getpeername

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Noticed while reviewing #4745: it seems that the getsockname added in 70f3b3ef8677 should have been a getpeername.

Child Tickets

Change History (7)

comment:1 Changed 9 years ago by nickm

Status: newneeds_review

See the first commit in branch "bug4745_4747" in my public repository.

Also, I have audited all the other uses of getsockname(), and haven't found any other mistakes.

comment:2 Changed 9 years ago by asn

< wanoskarnet> Every new bug (#4747) is the wrongly closed old ticket (#1240).
< asn> wanoskarnet: nickm: the question is, can anything bad happen when filling 'remote' with the local address at that point? (#4747)
< wanoskarnet> only spoofed logs. unless some comlicated nat configuration the it's leaves unlimited speed for link with poofed addr.
< asn> If the connection can survive with the local address in conn->addr, connection_is_rate_limited() will indeed not consider it.

As wanoskarnet pointed out, 'r1eo' in #1240 was many months ahead of us.

comment:3 Changed 9 years ago by nickm

'r1eo' gets 100 points for noticing this bug first. And if the "closing by request" comment afterwards is accurate, 'r1eo' then immediately loses 1000 points again.

comment:4 Changed 9 years ago by nickm

See #1240 instead.

comment:5 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Bug #1240 is now fixed, rendering this one irrelevant.

comment:6 Changed 8 years ago by nickm

Keywords: tor-relay added

comment:7 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.