diff options
Diffstat (limited to 'include/net/rtnetlink.h')
-rw-r--r-- | include/net/rtnetlink.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index dce7072bd28c..086fa9e89509 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -15,4 +15,12 @@ extern int rtnl_unregister(int protocol, int msgtype); | |||
15 | extern void rtnl_unregister_all(int protocol); | 15 | extern void rtnl_unregister_all(int protocol); |
16 | extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb); | 16 | extern int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb); |
17 | 17 | ||
18 | static inline int rtnl_msg_family(struct nlmsghdr *nlh) | ||
19 | { | ||
20 | if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) | ||
21 | return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family; | ||
22 | else | ||
23 | return AF_UNSPEC; | ||
24 | } | ||
25 | |||
18 | #endif | 26 | #endif |