mirror of
https://github.com/vishvananda/netlink
synced 2025-01-31 20:26:55 +00:00
Add syscall.NlMsghdr to LinkUpdate
Some header fields are needed in order to use LinkSubscribe, for instance it is useful to distinguish RTM_ADDLINK from RTM_DELLINK.
This commit is contained in:
parent
bfd70f5564
commit
5b0e1a0383
@ -815,6 +815,7 @@ func LinkList() ([]Link, error) {
|
||||
// LinkUpdate is used to pass information back from LinkSubscribe()
|
||||
type LinkUpdate struct {
|
||||
nl.IfInfomsg
|
||||
Header syscall.NlMsghdr
|
||||
Link
|
||||
}
|
||||
|
||||
@ -844,7 +845,7 @@ func LinkSubscribe(ch chan<- LinkUpdate, done <-chan struct{}) error {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ch <- LinkUpdate{IfInfomsg: *ifmsg, Link: link}
|
||||
ch <- LinkUpdate{IfInfomsg: *ifmsg, Header: m.Header, Link: link}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user