46 lines
1.8 KiB
Diff
46 lines
1.8 KiB
Diff
From: Ben Hutchings <ben@decadent.org.uk>
|
|
Subject: rtnetlink: avoid ABI change in 3.2.34
|
|
Date: Sun, 18 Nov 2012 03:25:48 +0000
|
|
|
|
Commit d318a127e273716c9531fe70d497ca24db4c0bf1 ('rtnetlink: Fix
|
|
problem with buffer allocation', commit
|
|
115c9b81928360d769a76c632bae62d15206a94a upstream) added a parameter
|
|
to the optional 'calcit' callback for rtnetlink operations. There is
|
|
only one in-tree implementation and it's in the same file as the
|
|
caller, so call it directly with the extra argument when necessary.
|
|
|
|
---
|
|
--- a/include/net/rtnetlink.h
|
|
+++ b/include/net/rtnetlink.h
|
|
@@ -6,7 +6,7 @@
|
|
|
|
typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
|
|
typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
|
|
-typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
|
|
+typedef u16 (*rtnl_calcit_func)(struct sk_buff *);
|
|
|
|
extern int __rtnl_register(int protocol, int msgtype,
|
|
rtnl_doit_func, rtnl_dumpit_func,
|
|
--- a/net/core/rtnetlink.c
|
|
+++ b/net/core/rtnetlink.c
|
|
@@ -2020,7 +2020,9 @@ static int rtnetlink_rcv_msg(struct sk_b
|
|
return -EOPNOTSUPP;
|
|
calcit = rtnl_get_calcit(family, type);
|
|
if (calcit)
|
|
- min_dump_alloc = calcit(skb, nlh);
|
|
+ min_dump_alloc = calcit(skb);
|
|
+ else if (type == RTM_GETLINK)
|
|
+ min_dump_alloc = rtnl_calcit(skb, nlh);
|
|
|
|
__rtnl_unlock();
|
|
rtnl = net->rtnl;
|
|
@@ -2136,7 +2138,7 @@ void __init rtnetlink_init(void)
|
|
register_netdevice_notifier(&rtnetlink_dev_notifier);
|
|
|
|
rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink,
|
|
- rtnl_dump_ifinfo, rtnl_calcit);
|
|
+ rtnl_dump_ifinfo, NULL);
|
|
rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL, NULL);
|
|
rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL, NULL);
|
|
rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL, NULL);
|