Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 http dialer add socket config; sockopt.mark use uint32 #1264

Merged
merged 2 commits into from Sep 10, 2021

Conversation

Vigilans
Copy link
Contributor

@Vigilans Vigilans commented Sep 9, 2021

This PR fixes two problems related to sockopt:

1. sockopt.mark config should accept uint32 instead of int32

Since some router (asus)'s iptables rule set the mark to be 0x80000000 (a negative number to int32), specifying 2147483648 in v2ray json config will result in error with loading SocketConfig.Mark.

2. HTTP Dialer should accept socket config when dialing

Ever since 5279296, all other dialers except http dialer accepts socket config (http dialer only provides a nil to DialSystem). It means outbounds with a http dialer will not set the socket mark even if specified in json config.

This is a shocking behavior that will lead to quite a lot unaccountable issues when configuring transparent proxy with v2ray http/http2 outbound.

Copy link
Contributor

@xiaokangwang xiaokangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! No issues were discovered.

@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2021

Codecov Report

Merging #1264 (28b33d0) into master (4a174e8) will increase coverage by 0.10%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1264      +/-   ##
==========================================
+ Coverage   44.76%   44.86%   +0.10%     
==========================================
  Files         485      485              
  Lines       29539    29539              
==========================================
+ Hits        13222    13252      +30     
+ Misses      14912    14891      -21     
+ Partials     1405     1396       -9     
Impacted Files Coverage Δ
common/session/session.go 70.58% <ø> (ø)
infra/conf/transport_internet.go 35.92% <ø> (ø)
transport/internet/config.pb.go 16.34% <0.00%> (ø)
transport/internet/http/dialer.go 61.17% <100.00%> (ø)
app/dns/dnscommon.go 87.87% <0.00%> (+1.51%) ⬆️
transport/internet/websocket/connection.go 20.18% <0.00%> (+3.66%) ⬆️
proxy/freedom/freedom.go 49.00% <0.00%> (+4.00%) ⬆️
common/buf/reader.go 88.23% <0.00%> (+5.88%) ⬆️
common/drain/drainer.go 72.41% <0.00%> (+6.89%) ⬆️
transport/internet/udp/dispatcher.go 77.14% <0.00%> (+12.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a174e8...28b33d0. Read the comment docs.

@kslr kslr changed the title Fix: sockopt problems 🐛 http dialer add socket config; sockopt.mark use uint32 Sep 10, 2021
@kslr kslr merged commit 4d155bc into v2fly:master Sep 10, 2021
Vigilans referenced this pull request Sep 17, 2021
xiaokangwang pushed a commit that referenced this pull request Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants