Skip to content

Commit a215b9f

Browse files
authored
[exporterhelper] [chore] Use int64 for the port proto fields (#13235)
from @bogdandrutu: int64 uses varint encoding, so for small value same size as int32, but does not need gosec converions
1 parent eee262b commit a215b9f

File tree

3 files changed

+60
-61
lines changed

3 files changed

+60
-61
lines changed

pdata/xpdata/request/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ func encodeClientAddress(ctx context.Context, rc *internal.RequestContext) {
7070
case *net.TCPAddr:
7171
rc.ClientAddress = &internal.RequestContext_Tcp{Tcp: &internal.TCPAddr{
7272
Ip: a.IP,
73-
Port: int32(a.Port), //nolint:gosec // G115
73+
Port: int64(a.Port),
7474
Zone: a.Zone,
7575
}}
7676
case *net.UDPAddr:
7777
rc.ClientAddress = &internal.RequestContext_Udp{Udp: &internal.UDPAddr{
7878
Ip: a.IP,
79-
Port: int32(a.Port), //nolint:gosec // G115
79+
Port: int64(a.Port),
8080
Zone: a.Zone,
8181
}}
8282
case *net.UnixAddr:

pdata/xpdata/request/internal/request.pb.go

Lines changed: 56 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdata/xpdata/request/internal/request.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ message IPAddr {
2828

2929
message TCPAddr {
3030
bytes ip = 1;
31-
int32 port = 2;
31+
int64 port = 2;
3232
string zone = 3;
3333
}
3434

3535
message UDPAddr {
3636
bytes ip = 1;
37-
int32 port = 2;
37+
int64 port = 2;
3838
string zone = 3;
3939
}
4040

0 commit comments

Comments
 (0)