How to monitor ip address change using RTNETLINK socket in go language
问题 I have following code, which should monitor network changes using RTNETLINK socket. However when I am setting new IP address for interface "New Addr" or "Del Addr" does not showing. What can be possible problem. package main import ( "fmt" "syscall" ) func main() { l, _ := ListenNetlink() for { msgs, err := l.ReadMsgs() if err != nil { fmt.Println("Could not read netlink: %s", err) } for _, m := range msgs { if IsNewAddr(&m) { fmt.Println("New Addr") } if IsDelAddr(&m) { fmt.Println("Del Addr