vlog: Fix typo in VLOG_IS_ERR_ENABLED macro definition.
[openvswitch] / lib / rtnetlink-link.c
index ffd615bfaf2e79a44088fea5c61f3c5cfd67a0db..98ab3991260fcef85fe2a6b0f3e4d97ed0de18e3 100644 (file)
 static struct rtnetlink *rtn = NULL;
 static struct rtnetlink_link_change rtn_change;
 
-static bool
+/* Parses a rtnetlink message 'buf' into 'change'.  If 'buf' is unparseable,
+ * leaves 'change' untouched and returns false.  Otherwise, populates 'change'
+ * and returns true. */
+bool
 rtnetlink_link_parse(struct ofpbuf *buf,
                      struct rtnetlink_link_change *change)
 {
@@ -68,24 +71,30 @@ rtnetlink_link_parse(struct ofpbuf *buf,
     return parsed;
 }
 
+static bool
+rtnetlink_link_parse_cb(struct ofpbuf *buf, void *change)
+{
+    return rtnetlink_link_parse(buf, change);
+}
+
 /* Registers 'cb' to be called with auxiliary data 'aux' with network device
  * change notifications.  The notifier is stored in 'notifier', which the
  * caller must not modify or free.
  *
  * This is probably not the function that you want.  You should probably be
- * using dpif_port_poll() or netdev_monitor_create(), which unlike this
- * function are not Linux-specific.
+ * using dpif_port_poll() or netdev_change_seq(), which unlike this function
+ * are not Linux-specific.
  *
  * Returns 0 if successful, otherwise a positive errno value. */
 int
 rtnetlink_link_notifier_register(struct rtnetlink_notifier *notifier,
                                  rtnetlink_link_notify_func *cb, void *aux)
 {
-    rtnetlink_parse_func *pf  = (rtnetlink_parse_func *) rtnetlink_link_parse;
     rtnetlink_notify_func *nf = (rtnetlink_notify_func *) cb;
 
     if (!rtn) {
-        rtn = rtnetlink_create(RTNLGRP_LINK, pf, &rtn_change);
+        rtn = rtnetlink_create(RTNLGRP_LINK, rtnetlink_link_parse_cb,
+                               &rtn_change);
     }
 
     return rtnetlink_notifier_register(rtn, notifier, nf, aux);