aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-05-22 20:00:49 -0400
committerDavid S. Miller <davem@davemloft.net>2007-05-22 20:00:49 -0400
commit575c3e2a041c08ad39b5d4535539a9a7d4c63aa6 (patch)
treec4402b3900356537f0d2426985376c4352e54c9a /net/core
parent83b496e928dbd38104bfb107230cc88751b09d89 (diff)
[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: Patrick McHardy <kaber@trash.net> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/rtnetlink.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 1a6c5b9d41b6..27da9cdec6a8 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -437,7 +437,7 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
437 a->tx_compressed = b->tx_compressed; 437 a->tx_compressed = b->tx_compressed;
438}; 438};
439 439
440static inline size_t if_nlmsg_size(int iwbuflen) 440static inline size_t if_nlmsg_size(void)
441{ 441{
442 return NLMSG_ALIGN(sizeof(struct ifinfomsg)) 442 return NLMSG_ALIGN(sizeof(struct ifinfomsg))
443 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ 443 + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
@@ -452,13 +452,12 @@ static inline size_t if_nlmsg_size(int iwbuflen)
452 + nla_total_size(4) /* IFLA_LINK */ 452 + nla_total_size(4) /* IFLA_LINK */
453 + nla_total_size(4) /* IFLA_MASTER */ 453 + nla_total_size(4) /* IFLA_MASTER */
454 + nla_total_size(1) /* IFLA_OPERSTATE */ 454 + nla_total_size(1) /* IFLA_OPERSTATE */
455 + nla_total_size(1) /* IFLA_LINKMODE */ 455 + nla_total_size(1); /* IFLA_LINKMODE */
456 + nla_total_size(iwbuflen);
457} 456}
458 457
459static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, 458static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
460 void *iwbuf, int iwbuflen, int type, u32 pid, 459 int type, u32 pid, u32 seq, u32 change,
461 u32 seq, u32 change, unsigned int flags) 460 unsigned int flags)
462{ 461{
463 struct ifinfomsg *ifm; 462 struct ifinfomsg *ifm;
464 struct nlmsghdr *nlh; 463 struct nlmsghdr *nlh;
@@ -523,9 +522,6 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
523 } 522 }
524 } 523 }
525 524
526 if (iwbuf)
527 NLA_PUT(skb, IFLA_WIRELESS, iwbuflen, iwbuf);
528
529 return nlmsg_end(skb, nlh); 525 return nlmsg_end(skb, nlh);
530 526
531nla_put_failure: 527nla_put_failure:
@@ -543,7 +539,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
543 for_each_netdev(dev) { 539 for_each_netdev(dev) {
544 if (idx < s_idx) 540 if (idx < s_idx)
545 goto cont; 541 goto cont;
546 if (rtnl_fill_ifinfo(skb, dev, NULL, 0, RTM_NEWLINK, 542 if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
547 NETLINK_CB(cb->skb).pid, 543 NETLINK_CB(cb->skb).pid,
548 cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0) 544 cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0)
549 break; 545 break;
@@ -737,8 +733,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
737 struct nlattr *tb[IFLA_MAX+1]; 733 struct nlattr *tb[IFLA_MAX+1];
738 struct net_device *dev = NULL; 734 struct net_device *dev = NULL;
739 struct sk_buff *nskb; 735 struct sk_buff *nskb;
740 char *iw_buf = NULL, *iw = NULL;
741 int iw_buf_len = 0;
742 int err; 736 int err;
743 737
744 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 738 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 } else 747 } else
754 return -EINVAL; 748 return -EINVAL;
755 749
756 nskb = nlmsg_new(if_nlmsg_size(iw_buf_len), GFP_KERNEL); 750 nskb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL);
757 if (nskb == NULL) { 751 if (nskb == NULL) {
758 err = -ENOBUFS; 752 err = -ENOBUFS;
759 goto errout; 753 goto errout;
760 } 754 }
761 755
762 err = rtnl_fill_ifinfo(nskb, dev, iw, iw_buf_len, RTM_NEWLINK, 756 err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid,
763 NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 0); 757 nlh->nlmsg_seq, 0, 0);
764 if (err < 0) { 758 if (err < 0) {
765 /* -EMSGSIZE implies BUG in if_nlmsg_size */ 759 /* -EMSGSIZE implies BUG in if_nlmsg_size */
766 WARN_ON(err == -EMSGSIZE); 760 WARN_ON(err == -EMSGSIZE);
@@ -769,7 +763,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
769 } 763 }
770 err = rtnl_unicast(nskb, NETLINK_CB(skb).pid); 764 err = rtnl_unicast(nskb, NETLINK_CB(skb).pid);
771errout: 765errout:
772 kfree(iw_buf);
773 dev_put(dev); 766 dev_put(dev);
774 767
775 return err; 768 return err;
@@ -804,11 +797,11 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
804 struct sk_buff *skb; 797 struct sk_buff *skb;
805 int err = -ENOBUFS; 798 int err = -ENOBUFS;
806 799
807 skb = nlmsg_new(if_nlmsg_size(0), GFP_KERNEL); 800 skb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL);
808 if (skb == NULL) 801 if (skb == NULL)
809 goto errout; 802 goto errout;
810 803
811 err = rtnl_fill_ifinfo(skb, dev, NULL, 0, type, 0, 0, change, 0); 804 err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
812 if (err < 0) { 805 if (err < 0) {
813 /* -EMSGSIZE implies BUG in if_nlmsg_size() */ 806 /* -EMSGSIZE implies BUG in if_nlmsg_size() */
814 WARN_ON(err == -EMSGSIZE); 807 WARN_ON(err == -EMSGSIZE);