mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-21 17:56:39 +00:00
Add kernel conntrack counters (#3434)
This commit is contained in:
@@ -57,7 +57,7 @@ func (m *Manager) Update(update *nftypes.FlowConfig) error {
|
||||
|
||||
if update.Enabled {
|
||||
if m.conntrack != nil {
|
||||
if err := m.conntrack.Start(); err != nil {
|
||||
if err := m.conntrack.Start(update.Counters); err != nil {
|
||||
return fmt.Errorf("start conntrack: %w", err)
|
||||
}
|
||||
}
|
||||
@@ -157,6 +157,10 @@ func toProtoEvent(publicKey []byte, event *nftypes.Event) *proto.FlowEvent {
|
||||
Protocol: uint32(event.Protocol),
|
||||
SourceIp: event.SourceIP.AsSlice(),
|
||||
DestIp: event.DestIP.AsSlice(),
|
||||
RxPackets: event.RxPackets,
|
||||
TxPackets: event.TxPackets,
|
||||
RxBytes: event.RxBytes,
|
||||
TxBytes: event.TxBytes,
|
||||
},
|
||||
}
|
||||
if event.Protocol == nftypes.ICMP {
|
||||
|
||||
Reference in New Issue
Block a user