Opened 3 years ago

Closed 2 years ago

#20107 closed defect (worksforme)

somthings wrong about function channel_get_actual_remote_address()

Reported by: DLP_ripper Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.8.7
Severity: Normal Keywords: channel, ip, address
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

description

function channel_get_actual_remote_address is written to get the ip address of a channel, but when we use it in function command_process_created_cell, we find that it get the same ip address about circ->n_chan and TO_OR_CIRCUIT(circ)->p_chan.
But actually they have different ip address because TO_OR_CIRCUIT(circ)->p_chan is not equals to circ->n_chan, and TO_OR_CIRCUIT(circ)->p_circ_id is not equals to circ->n_circ_id.

test

If you want to check whether I am right, you can add this code into the last line in function command_process_created_cell, the funtion is written in the file
command.c. I have check it in tor-0.2.8.7 and tor-0.2.7.6.

log_notice(LD_GENERAL, "p_ip_addr:%s, p_circ_id:%u, n_ip_addr:%s, n_circ_id:%u",
                channel_get_actual_remote_address(TO_OR_CIRCUIT(circ)->p_chan),
                TO_OR_CIRCUIT(circ)->p_circ_id,
                channel_get_actual_remote_address(circ->n_chan), 
                cell->circ_id);

Child Tickets

Change History (11)

comment:1 Changed 3 years ago by gk

Component: - Select a componentCore Tor/Tor

comment:2 Changed 3 years ago by nickm

Keywords: 028-backport added
Milestone: Tor: 0.2.8.x-finalTor: 0.2.9.x-final

comment:3 Changed 3 years ago by nickm

when we use it in function command_process_created_cell

I'm fairly confused here. There isn't actually any call to channel_get_actual_remote_address() in command_process_created_cell(), or in command.c at all, as far as I can tell.

Any thoughts here?

comment:4 Changed 3 years ago by nickm

Status: newneeds_information

comment:5 Changed 3 years ago by arma

No need for this ticket to hold up a Tor 0.2.9.x stable imo.

DLP_ripper, can you tell us what you are actually trying to do?

Most likely the original poster is getting confused by our confusing and insufficiently documented design of rewriting the remote address once we think we know what relay it is.

comment:6 in reply to:  3 Changed 3 years ago by DLP_ripper

Actually, I want to check the source ip address of a cell, but when I log out the ip address here, the information is so strange.

So I think maybe it is a bug here and I report it.

Replying to nickm:

when we use it in function command_process_created_cell

I'm fairly confused here. There isn't actually any call to channel_get_actual_remote_address() in command_process_created_cell(), or in command.c at all, as far as I can tell.

Any thoughts here?

Last edited 3 years ago by DLP_ripper (previous) (diff)

comment:7 Changed 3 years ago by nickm

Milestone: Tor: 0.2.9.x-finalTor: 0.3.0.x-final

comment:8 Changed 3 years ago by dgoulet

Keywords: triage-out-030-201612 added
Milestone: Tor: 0.3.0.x-finalTor: unspecified

Triaged out on December 2016 from 030 to Unspecified.

comment:9 Changed 2 years ago by nickm

Keywords: triage-out-030-201612 removed

comment:10 Changed 2 years ago by nickm

Keywords: 028-backport removed

comment:11 Changed 2 years ago by nickm

Resolution: worksforme
Status: needs_informationclosed

Yeah -- this is rewriting stuff is _weird_, but not _wrong_.

Note: See TracTickets for help on using tickets.