-
Notifications
You must be signed in to change notification settings - Fork 755
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
Preserve results when NLM_F_DUMP_INTR is set #1050
Preserve results when NLM_F_DUMP_INTR is set #1050
Conversation
conntrack_linux.go
Outdated
return 0, err | ||
} | ||
|
||
errMsgs = append(errMsgs, err.Error()) |
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.
this allows us to at least do a best effort to try to clean the entries matching the filter
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.
Just occurred to me; err may be nil
here? Should probably be inside the err != nil
branch? Perhaps also a comment couldn't hurt?
if err != nil {
if !errors.Is(err, ErrDumpInterrupted) {
return 0, err
}
// This allows us to at least do a best effort to try to clean the
// entries matching the filter.
errMsgs = append(errMsgs, err.Error())
}
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.
Good catch, thank you. Fixed in 2742887
LGTM ping @aboch |
conntrack_linux.go
Outdated
|
||
// Protocol returns "tcp". | ||
func (*ProtoInfoTCP) Protocol() string {return "tcp"} | ||
func (*ProtoInfoTCP) Protocol() string { return "tcp" } | ||
func (p *ProtoInfoTCP) toNlData() ([]*nl.RtAttr, error) { | ||
ctProtoInfo := nl.NewRtAttr(unix.NLA_F_NESTED | nl.CTA_PROTOINFO, []byte{}) | ||
ctProtoInfo := nl.NewRtAttr(unix.NLA_F_NESTED|nl.CTA_PROTOINFO, []byte{}) |
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.
Looks like some unrelated formatting changes made it in. It's a bit of a pain (my IDE also formats these on save), but better to handle those separate from this change;
- can you revert the formatting changes
- squash the commits? (second commit is fixing up the first one, and as the first one isn't merged yet, we may as well keep it as a single change).
I have a PR pending to fix formatting for the whole repo that's still pending; #1009
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.
Yeah, sorry. I should have checked that before pushing. I'll fix it now.
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.
No worries! It's a bit of a pain for sure!
I'm not a maintainer on this repository, but hope that "gofumpt" PR gets accepted and merged, as I find myself undoing formatting changes every time 😂
2742887
to
bfa83ee
Compare
Similar to vishvananda#1018, but for ConntrackDeleteFilters() Relates to kubernetes/kubernetes#129562
01177bd
to
665565b
Compare
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.
LGTM
LGTM |
Similar to #1018, but for ConntrackDeleteFilters()
Relates to kubernetes/kubernetes#129562