aboutsummaryrefslogtreecommitdiff
path: root/lib/rtnetlink-link.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-03 10:10:41 -0700
committerBen Pfaff <blp@nicira.com>2011-06-07 17:05:42 -0700
commit9292989d05b1a468d17bce8f6222f5344bab6b03 (patch)
tree2a40f9807fc535c4effa5846aad74bde501545a9 /lib/rtnetlink-link.c
parentcb8ca532a6636d20c9d7e4a5323489cad9c3eeb7 (diff)
rtnetlink-link: Avoid cast in rtnetlink_link_notifier_register().
It's easy enough to avoid this cast by going through a thunk function. (The other cast in this function is harder to avoid.) This is just a cleanup that doesn't fix any actual bug.
Diffstat (limited to 'lib/rtnetlink-link.c')
-rw-r--r--lib/rtnetlink-link.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rtnetlink-link.c b/lib/rtnetlink-link.c
index 09ba954e..98ab3991 100644
--- a/lib/rtnetlink-link.c
+++ b/lib/rtnetlink-link.c
@@ -71,6 +71,12 @@ 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.
@@ -84,11 +90,11 @@ 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);