Opened 5 years ago

Closed 5 years ago

#16056 closed defect (fixed)

getinfo exit-policy/ipv6 does not show masks >= 32

Reported by: gturner Owned by:
Priority: High Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords: TorCoreTeam201512
Cc: Actual Points:
Parent ID: Points: small
Reviewer: Sponsor:


After enabling IPv6 on an exit node, I was discouraged by the lack of IPv6 policy displayed on Atlas, where there is a section in which IPv6 policy should be displayed, but the list is empty for my node, causing me to fear that my exit node could be used to relay spam on port 25 over IPv6, etc.

So I connected to the ControlPort and issued "getinfo exit-policy/ipv6" to confirm that there are sane defaults being applied to IPv6 policy. Indeed there are, and even private networks like "reject6 [fc00::]/7:*" are automatically configured, great!

However policies that I manually added, for example:

ExitPolicy reject6 [2610:148:1f10::]/48:*

...are not being output correctly by the getinfo command, for example:

reject6 [2610:148:1f10::]:* mask!

Turns out that in function policy_write_item in src/or/policies.c the mask is being hidden if mask bits is >= 32, which makes sense for IPv4, but for IPv6 the test should be 128.

Attached is a trivial patch which I've tested and confirmed it corrects the getinfo policy output.

Child Tickets

Attachments (1)

tor-policy-dump-fix-ip6-mask.patch (795 bytes) - added by gturner 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by gturner

comment:1 Changed 5 years ago by nickm

Milestone: Tor: 0.2.8.x-final

comment:2 Changed 5 years ago by nickm

Points: small
Priority: normalmajor

comment:3 Changed 5 years ago by teor

Keywords: TorCoreTeam201512 added
Severity: Normal
Status: newneeds_review

This is a one-line patch which makes getinfo exit-policy/ipv6 work much better.

Let's get it merged!

comment:4 Changed 5 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Looks good; merged to 0.2.7 as trivially correct.

Note: See TracTickets for help on using tickets.