-
Notifications
You must be signed in to change notification settings - Fork 0
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
Detect interface changes and start/stop new/removed lldp discovery #73
base: master
Are you sure you want to change the base?
Conversation
|
||
func (c *Core) startLLDPDiscovery(ctx context.Context, discoveryResultChan chan lldp.DiscoveryResult, iface net.Interface) { | ||
// consider only switch port interfaces | ||
if !strings.HasPrefix(iface.Name, "swp") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cmd/internal/core/detect-changes.go line 32 the interface is checked for "swp" prefix.
If the same check gets kept in cmd/internal/core/phone-home.go then behavious is consistent across callers (both only call this function for "swp" interfaces) and the duplicate check here could be dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is a bit too spread, will think of a solution, maybe factoring interface listing to a separate func (which also detects switch os in the future, SONiC hast "Ethernet.." )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the PR #68 for a possible solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Fix for #55 and #3
TODO: