Skip to content
Snippets Groups Projects
Unverified Commit 434968e1 authored by Mohamed S. Mahmoud's avatar Mohamed S. Mahmoud Committed by GitHub
Browse files

NETOBSERV-1743: handle file exits error using TCx hooks and update FC (#363)

parent bed25c59
No related branches found
No related tags found
No related merge requests found
...@@ -230,7 +230,12 @@ func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error { ...@@ -230,7 +230,12 @@ func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index, Interface: iface.Index,
}) })
if err != nil { if err != nil {
return fmt.Errorf("failed to attach TCX egress: %w", err) if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX egress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX egress hook ignore")
} else {
return fmt.Errorf("failed to attach TCX egress: %w", err)
}
} }
m.egressTCXLink[iface] = egrLink m.egressTCXLink[iface] = egrLink
ilog.WithField("interface", iface.Name).Debug("successfully attach egressTCX hook") ilog.WithField("interface", iface.Name).Debug("successfully attach egressTCX hook")
...@@ -243,7 +248,12 @@ func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error { ...@@ -243,7 +248,12 @@ func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index, Interface: iface.Index,
}) })
if err != nil { if err != nil {
return fmt.Errorf("failed to attach TCX ingress: %w", err) if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX ingress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX ingress hook ignore")
} else {
return fmt.Errorf("failed to attach TCX ingress: %w", err)
}
} }
m.ingressTCXLink[iface] = ingLink m.ingressTCXLink[iface] = ingLink
ilog.WithField("interface", iface.Name).Debug("successfully attach ingressTCX hook") ilog.WithField("interface", iface.Name).Debug("successfully attach ingressTCX hook")
...@@ -928,7 +938,12 @@ func (p *PacketFetcher) AttachTCX(iface ifaces.Interface) error { ...@@ -928,7 +938,12 @@ func (p *PacketFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index, Interface: iface.Index,
}) })
if err != nil { if err != nil {
return fmt.Errorf("failed to attach PCA TCX egress: %w", err) if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX egress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX PCA egress hook ignore")
} else {
return fmt.Errorf("failed to attach PCA TCX egress: %w", err)
}
} }
p.egressTCXLink[iface] = egrLink p.egressTCXLink[iface] = egrLink
ilog.WithField("interface", iface.Name).Debug("successfully attach PCA egressTCX hook") ilog.WithField("interface", iface.Name).Debug("successfully attach PCA egressTCX hook")
...@@ -941,7 +956,12 @@ func (p *PacketFetcher) AttachTCX(iface ifaces.Interface) error { ...@@ -941,7 +956,12 @@ func (p *PacketFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index, Interface: iface.Index,
}) })
if err != nil { if err != nil {
return fmt.Errorf("failed to attach PCA TCX ingress: %w", err) if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX ingress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX PCA ingress hook ignore")
} else {
return fmt.Errorf("failed to attach PCA TCX ingress: %w", err)
}
} }
p.ingressTCXLink[iface] = ingLink p.ingressTCXLink[iface] = ingLink
ilog.WithField("interface", iface.Name).Debug("successfully attach PCA ingressTCX hook") ilog.WithField("interface", iface.Name).Debug("successfully attach PCA ingressTCX hook")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment