Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed Nov 7, 2024
1 parent bbf6f92 commit b7aaba9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions x/sockopt/sockopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ func newHopLimit(conn net.Conn) (*hopLimitOption, error) {
opt := &hopLimitOption{}
switch {
case addr.Addr().Is4():
conn := ipv4.NewConn(conn)
opt.hopLimit = conn.TTL
opt.setHopLimit = conn.SetTTL
ipConn := ipv4.NewConn(conn)
opt.hopLimit = ipConn.TTL
opt.setHopLimit = ipConn.SetTTL
case addr.Addr().Is6():
conn := ipv6.NewConn(conn)
opt.hopLimit = conn.HopLimit
opt.setHopLimit = conn.SetHopLimit
ipConn := ipv6.NewConn(conn)
opt.hopLimit = ipConn.HopLimit
opt.setHopLimit = ipConn.SetHopLimit
default:
return nil, fmt.Errorf("address is not IPv4 or IPv6 (%v)", addr.Addr().String())
}
Expand Down

0 comments on commit b7aaba9

Please sign in to comment.