Skip to content

Commit

Permalink
🧤 service: include packet size in send errors
Browse files Browse the repository at this point in the history
This should come in handy when diagnosing -EMSGSIZE errors.

It's unfortunate that the current Mmsg{R,W}Conn API hides the info from us. Maybe the next commit should tackle this.
  • Loading branch information
database64128 committed Nov 1, 2023
1 parent 8f9abae commit aef6bf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions service/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ func (c *client) relayWgToProxyGeneric(uplink clientNatUplinkGeneric) {
zap.String("listenAddress", c.wgListen),
zap.Stringer("clientAddress", uplink.clientAddrPort),
zap.Stringer("proxyAddress", uplink.proxyAddrPort),
zap.Int("swgpPacketLength", swgpPacketLength),
zap.Error(err),
)
}
Expand Down Expand Up @@ -575,6 +576,7 @@ func (c *client) relayProxyToWgGeneric(downlink clientNatDownlinkGeneric) {
zap.String("listenAddress", c.wgListen),
zap.Stringer("clientAddress", downlink.clientAddrPort),
zap.Stringer("proxyAddress", downlink.proxyAddrPort),
zap.Int("wgPacketLength", wgPacketLength),
zap.Error(err),
)
}
Expand Down
2 changes: 2 additions & 0 deletions service/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ func (s *server) relayProxyToWgGeneric(uplink serverNatUplinkGeneric) {
zap.String("listenAddress", s.proxyListen),
zap.Stringer("clientAddress", uplink.clientAddrPort),
zap.Stringer("wgAddress", uplink.wgAddrPort),
zap.Int("wgPacketLength", queuedPacket.length),
zap.Error(err),
)
}
Expand Down Expand Up @@ -556,6 +557,7 @@ func (s *server) relayWgToProxyGeneric(downlink serverNatDownlinkGeneric) {
zap.String("listenAddress", s.proxyListen),
zap.Stringer("clientAddress", downlink.clientAddrPort),
zap.Stringer("wgAddress", downlink.wgAddrPort),
zap.Int("swgpPacketLength", swgpPacketLength),
zap.Error(err),
)
}
Expand Down

0 comments on commit aef6bf6

Please sign in to comment.