veyron/lib/netconfig: change netconfig watchers to monitor route changes as well.
o This is for avoiding calling nestats.GetAll(), which is expensive, in every RPC call.
o I couldn't find any documentation on netconfig monitoring, so I'm
not sure whether this is a right way to do.
Change-Id: I17c0aad0c434f8d7ec6323280b79ccc2dc260386
diff --git a/lib/netconfig/ipaux_bsd.go b/lib/netconfig/ipaux_bsd.go
index e1824d4..64924a0 100644
--- a/lib/netconfig/ipaux_bsd.go
+++ b/lib/netconfig/ipaux_bsd.go
@@ -14,6 +14,7 @@
"sync"
"syscall"
"time"
+
"v.io/core/veyron2/vlog"
)
@@ -95,6 +96,7 @@
switch m.(type) {
case *syscall.InterfaceMessage:
case *syscall.InterfaceAddrMessage:
+ case *syscall.RouteMessage:
default:
continue
}
diff --git a/lib/netconfig/ipaux_linux.go b/lib/netconfig/ipaux_linux.go
index 2f217b6..b2a14ca 100644
--- a/lib/netconfig/ipaux_linux.go
+++ b/lib/netconfig/ipaux_linux.go
@@ -14,6 +14,7 @@
"syscall"
"time"
"unsafe"
+
"v.io/core/veyron2/vlog"
)
@@ -273,7 +274,7 @@
}
const (
- GROUPS = C.RTMGRP_LINK | C.RTMGRP_IPV4_IFADDR | C.RTMGRP_IPV6_IFADDR | C.RTMGRP_NOTIFY
+ GROUPS = C.RTMGRP_LINK | C.RTMGRP_IPV4_IFADDR | C.RTMGRP_IPV4_MROUTE | C.RTMGRP_IPV4_ROUTE | C.RTMGRP_IPV6_IFADDR | C.RTMGRP_IPV6_MROUTE | C.RTMGRP_IPV6_ROUTE | C.RTMGRP_NOTIFY
)
// NewNetConfigWatcher returns a watcher that wakes up anyone