Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sflow]Changing the verbosity of ERR log when interface is unavailable #93

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 3d6a3a02d12bcd742e9bcd701cb77da5f265adee Mon Sep 17 00:00:00 2001
From: Neil McKee <[email protected]>
Date: Fri, 26 Apr 2024 11:05:19 -0700
Subject: [PATCH] When interface removed just as we discover it, log with
LOG_INFO, not LOG_ERR.


diff --git a/src/Linux/readInterfaces.c b/src/Linux/readInterfaces.c
index 438d8ed..06427eb 100644
--- a/src/Linux/readInterfaces.c
+++ b/src/Linux/readInterfaces.c
@@ -758,7 +758,8 @@ extern "C" {

// Get the flags for this interface
if(ioctl(fd,SIOCGIFFLAGS, &ifr) < 0) {
- myLog(LOG_ERR, "device %s Get SIOCGIFFLAGS failed : %s",
+ // Can get here if the interface was just removed under our feet.
+ myLog(LOG_INFO, "device %s Get SIOCGIFFLAGS failed : %s",
devName,
strerror(errno));
continue;
@@ -781,7 +782,7 @@ extern "C" {
u_char macBytes[6];
int gotMac = NO;
if(ioctl(fd,SIOCGIFHWADDR, &ifr) < 0) {
- myLog(LOG_ERR, "device %s Get SIOCGIFHWADDR failed : %s",
+ myLog(LOG_INFO, "device %s Get SIOCGIFHWADDR failed : %s",
devName,
strerror(errno));
}
--
2.30.2

1 change: 1 addition & 0 deletions src/sflow/hsflowd/patch/series
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
0001-host_sflow_psample.patch
0002-host_sflow_debian.patch
0003-sflow-enabled-drop-monitor-support-for-SONiC.patch
0004-When-interface-removed-just-as-we-discover-it-log-wi.patch