Skip to content

Commit

Permalink
mod_sonic handle collector VRF default
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Jul 10, 2020
1 parent 5bbd86d commit 48c0ada
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hsflowd.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: host sFlow daemon
Name: hsflowd
Version: 2.0.28
Release: 1
Release: 2
License: http://sflow.net/license.html
Group: Applications/Internet
URL: http://sflow.net
Expand Down
5 changes: 4 additions & 1 deletion src/Linux/mod_sonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ extern "C" {
#define HSP_SONIC_FIELD_COLLECTOR_IP "collector_ip"
#define HSP_SONIC_FIELD_COLLECTOR_PORT "collector_port"
#define HSP_SONIC_FIELD_COLLECTOR_VRF "collector_vrf"
#define HSP_SONIC_VRF_DEFAULT "default"

#define HSP_SONIC_DEFAULT_POLLING_INTERVAL 20
#define HSP_SONIC_MIN_POLLING_INTERVAL 5
Expand Down Expand Up @@ -1316,7 +1317,9 @@ extern "C" {
coll->port = SFL_DEFAULT_COLLECTOR_PORT;
}
if(my_strequal(f_name->str, HSP_SONIC_FIELD_COLLECTOR_VRF)) {
coll->deviceName = my_strdup(f_val->str);
// only set deviceName if the VRF is not the default
if(!my_strequal(f_val->str, HSP_SONIC_VRF_DEFAULT))
coll->deviceName = my_strdup(f_val->str);
}
}
}
Expand Down

0 comments on commit 48c0ada

Please sign in to comment.