Commit 575c3e2a authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[RTNETLINK]: Remove remains of wireless extensions over rtnetlink

Remove some unused variables and function arguments related to the
recently removed wireless extensions over rtnetlink.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83b496e9
...@@ -437,7 +437,7 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a, ...@@ -437,7 +437,7 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
a->tx_compressed = b->tx_compressed; a->tx_compressed = b->tx_compressed;
}; };
static inline size_t if_nlmsg_size(int iwbuflen) static inline size_t if_nlmsg_size(void)
{ {
return NLMSG_ALIGN(sizeof(struct ifinfomsg)) return NLMSG_ALIGN(sizeof(struct ifinfomsg))
+ nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
...@@ -452,13 +452,12 @@ static inline size_t if_nlmsg_size(int iwbuflen) ...@@ -452,13 +452,12 @@ static inline size_t if_nlmsg_size(int iwbuflen)
+ nla_total_size(4) /* IFLA_LINK */ + nla_total_size(4) /* IFLA_LINK */
+ nla_total_size(4) /* IFLA_MASTER */ + nla_total_size(4) /* IFLA_MASTER */
+ nla_total_size(1) /* IFLA_OPERSTATE */ + nla_total_size(1) /* IFLA_OPERSTATE */
+ nla_total_size(1) /* IFLA_LINKMODE */ + nla_total_size(1); /* IFLA_LINKMODE */
+ nla_total_size(iwbuflen);
} }
static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
void *iwbuf, int iwbuflen, int type, u32 pid, int type, u32 pid, u32 seq, u32 change,
u32 seq, u32 change, unsigned int flags) unsigned int flags)
{ {
struct ifinfomsg *ifm; struct ifinfomsg *ifm;
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
...@@ -523,9 +522,6 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, ...@@ -523,9 +522,6 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
} }
} }
if (iwbuf)
NLA_PUT(skb, IFLA_WIRELESS, iwbuflen, iwbuf);
return nlmsg_end(skb, nlh); return nlmsg_end(skb, nlh);
nla_put_failure: nla_put_failure:
...@@ -543,7 +539,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -543,7 +539,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
for_each_netdev(dev) { for_each_netdev(dev) {
if (idx < s_idx) if (idx < s_idx)
goto cont; goto cont;
if (rtnl_fill_ifinfo(skb, dev, NULL, 0, RTM_NEWLINK, if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
NETLINK_CB(cb->skb).pid, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0) cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0)
break; break;
...@@ -737,8 +733,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) ...@@ -737,8 +733,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
struct nlattr *tb[IFLA_MAX+1]; struct nlattr *tb[IFLA_MAX+1];
struct net_device *dev = NULL; struct net_device *dev = NULL;
struct sk_buff *nskb; struct sk_buff *nskb;
char *iw_buf = NULL, *iw = NULL;
int iw_buf_len = 0;
int err; int err;
err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
...@@ -753,14 +747,14 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) ...@@ -753,14 +747,14 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
} else } else
return -EINVAL; return -EINVAL;
nskb = nlmsg_new(if_nlmsg_size(iw_buf_len), GFP_KERNEL); nskb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL);
if (nskb == NULL) { if (nskb == NULL) {
err = -ENOBUFS; err = -ENOBUFS;
goto errout; goto errout;
} }
err = rtnl_fill_ifinfo(nskb, dev, iw, iw_buf_len, RTM_NEWLINK, err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid,
NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 0); nlh->nlmsg_seq, 0, 0);
if (err < 0) { if (err < 0) {
/* -EMSGSIZE implies BUG in if_nlmsg_size */ /* -EMSGSIZE implies BUG in if_nlmsg_size */
WARN_ON(err == -EMSGSIZE); WARN_ON(err == -EMSGSIZE);
...@@ -769,7 +763,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) ...@@ -769,7 +763,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
} }
err = rtnl_unicast(nskb, NETLINK_CB(skb).pid); err = rtnl_unicast(nskb, NETLINK_CB(skb).pid);
errout: errout:
kfree(iw_buf);
dev_put(dev); dev_put(dev);
return err; return err;
...@@ -804,11 +797,11 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) ...@@ -804,11 +797,11 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
struct sk_buff *skb; struct sk_buff *skb;
int err = -ENOBUFS; int err = -ENOBUFS;
skb = nlmsg_new(if_nlmsg_size(0), GFP_KERNEL); skb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL);
if (skb == NULL) if (skb == NULL)
goto errout; goto errout;
err = rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0); err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
if (err < 0) { if (err < 0) {
/* -EMSGSIZE implies BUG in if_nlmsg_size() */ /* -EMSGSIZE implies BUG in if_nlmsg_size() */
WARN_ON(err == -EMSGSIZE); WARN_ON(err == -EMSGSIZE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment