Skip to content

Commit e21be26

Browse files
committed
[sflow]Changing the verbosity of ERR log when interface is unavailable
1 parent 489a1ef commit e21be26

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 3d6a3a02d12bcd742e9bcd701cb77da5f265adee Mon Sep 17 00:00:00 2001
2+
From: Neil McKee <neil.mckee@inmon.com>
3+
Date: Fri, 26 Apr 2024 11:05:19 -0700
4+
Subject: [PATCH] When interface removed just as we discover it, log with
5+
LOG_INFO, not LOG_ERR.
6+
7+
8+
diff --git a/src/Linux/readInterfaces.c b/src/Linux/readInterfaces.c
9+
index 438d8ed..06427eb 100644
10+
--- a/src/Linux/readInterfaces.c
11+
+++ b/src/Linux/readInterfaces.c
12+
@@ -758,7 +758,8 @@ extern "C" {
13+
14+
// Get the flags for this interface
15+
if(ioctl(fd,SIOCGIFFLAGS, &ifr) < 0) {
16+
- myLog(LOG_ERR, "device %s Get SIOCGIFFLAGS failed : %s",
17+
+ // Can get here if the interface was just removed under our feet.
18+
+ myLog(LOG_INFO, "device %s Get SIOCGIFFLAGS failed : %s",
19+
devName,
20+
strerror(errno));
21+
continue;
22+
@@ -781,7 +782,7 @@ extern "C" {
23+
u_char macBytes[6];
24+
int gotMac = NO;
25+
if(ioctl(fd,SIOCGIFHWADDR, &ifr) < 0) {
26+
- myLog(LOG_ERR, "device %s Get SIOCGIFHWADDR failed : %s",
27+
+ myLog(LOG_INFO, "device %s Get SIOCGIFHWADDR failed : %s",
28+
devName,
29+
strerror(errno));
30+
}
31+
--
32+
2.30.2
33+

src/sflow/hsflowd/patch/series

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
0001-host_sflow_psample.patch
22
0002-host_sflow_debian.patch
33
0003-sflow-enabled-drop-monitor-support-for-SONiC.patch
4+
0004-When-interface-removed-just-as-we-discover-it-log-wi.patch

0 commit comments

Comments
 (0)