diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 11:16:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 11:16:24 -0400 |
commit | 4598c95514f9a50b49626e1e5d1f292180b643fa (patch) | |
tree | 8f6bee748bf326f61b07b2bcbd931f894fd2713b | |
parent | 641e22e04c48af5d813f119c55336e02a22756f5 (diff) | |
parent | 575c3e2a041c08ad39b5d4535539a9a7d4c63aa6 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[RTNETLINK]: Remove remains of wireless extensions over rtnetlink
[RTNETLINK]: Allow changing of subsets of netdevice flags in rtnl_setlink
[AF_RXRPC]: Make call state names available if CONFIG_PROC_FS=n
[AF_RXRPC]: AF_RXRPC depends on IPv4
[IPSEC]: Fix warnings with casting int to pointer
-rw-r--r-- | net/core/rtnetlink.c | 38 | ||||
-rw-r--r-- | net/rxrpc/Kconfig | 2 | ||||
-rw-r--r-- | net/rxrpc/ar-call.c | 19 | ||||
-rw-r--r-- | net/rxrpc/ar-proc.c | 19 | ||||
-rw-r--r-- | net/xfrm/xfrm_algo.c | 8 |
5 files changed, 43 insertions, 43 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8c971a2efe2a..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 | ||
440 | static inline size_t if_nlmsg_size(int iwbuflen) | 440 | static 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 | ||
459 | static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, | 458 | static 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 | ||
531 | nla_put_failure: | 527 | nla_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; |
@@ -689,8 +685,15 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
689 | } | 685 | } |
690 | 686 | ||
691 | 687 | ||
692 | if (ifm->ifi_flags) | 688 | if (ifm->ifi_flags || ifm->ifi_change) { |
693 | dev_change_flags(dev, ifm->ifi_flags); | 689 | unsigned int flags = ifm->ifi_flags; |
690 | |||
691 | /* bugwards compatibility: ifi_change == 0 is treated as ~0 */ | ||
692 | if (ifm->ifi_change) | ||
693 | flags = (flags & ifm->ifi_change) | | ||
694 | (dev->flags & ~ifm->ifi_change); | ||
695 | dev_change_flags(dev, flags); | ||
696 | } | ||
694 | 697 | ||
695 | if (tb[IFLA_TXQLEN]) | 698 | if (tb[IFLA_TXQLEN]) |
696 | dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); | 699 | dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); |
@@ -730,8 +733,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
730 | struct nlattr *tb[IFLA_MAX+1]; | 733 | struct nlattr *tb[IFLA_MAX+1]; |
731 | struct net_device *dev = NULL; | 734 | struct net_device *dev = NULL; |
732 | struct sk_buff *nskb; | 735 | struct sk_buff *nskb; |
733 | char *iw_buf = NULL, *iw = NULL; | ||
734 | int iw_buf_len = 0; | ||
735 | int err; | 736 | int err; |
736 | 737 | ||
737 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); | 738 | err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); |
@@ -746,14 +747,14 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
746 | } else | 747 | } else |
747 | return -EINVAL; | 748 | return -EINVAL; |
748 | 749 | ||
749 | nskb = nlmsg_new(if_nlmsg_size(iw_buf_len), GFP_KERNEL); | 750 | nskb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL); |
750 | if (nskb == NULL) { | 751 | if (nskb == NULL) { |
751 | err = -ENOBUFS; | 752 | err = -ENOBUFS; |
752 | goto errout; | 753 | goto errout; |
753 | } | 754 | } |
754 | 755 | ||
755 | 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, |
756 | NETLINK_CB(skb).pid, nlh->nlmsg_seq, 0, 0); | 757 | nlh->nlmsg_seq, 0, 0); |
757 | if (err < 0) { | 758 | if (err < 0) { |
758 | /* -EMSGSIZE implies BUG in if_nlmsg_size */ | 759 | /* -EMSGSIZE implies BUG in if_nlmsg_size */ |
759 | WARN_ON(err == -EMSGSIZE); | 760 | WARN_ON(err == -EMSGSIZE); |
@@ -762,7 +763,6 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | |||
762 | } | 763 | } |
763 | err = rtnl_unicast(nskb, NETLINK_CB(skb).pid); | 764 | err = rtnl_unicast(nskb, NETLINK_CB(skb).pid); |
764 | errout: | 765 | errout: |
765 | kfree(iw_buf); | ||
766 | dev_put(dev); | 766 | dev_put(dev); |
767 | 767 | ||
768 | return err; | 768 | return err; |
@@ -797,11 +797,11 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change) | |||
797 | struct sk_buff *skb; | 797 | struct sk_buff *skb; |
798 | int err = -ENOBUFS; | 798 | int err = -ENOBUFS; |
799 | 799 | ||
800 | skb = nlmsg_new(if_nlmsg_size(0), GFP_KERNEL); | 800 | skb = nlmsg_new(if_nlmsg_size(), GFP_KERNEL); |
801 | if (skb == NULL) | 801 | if (skb == NULL) |
802 | goto errout; | 802 | goto errout; |
803 | 803 | ||
804 | 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); |
805 | if (err < 0) { | 805 | if (err < 0) { |
806 | /* -EMSGSIZE implies BUG in if_nlmsg_size() */ | 806 | /* -EMSGSIZE implies BUG in if_nlmsg_size() */ |
807 | WARN_ON(err == -EMSGSIZE); | 807 | WARN_ON(err == -EMSGSIZE); |
diff --git a/net/rxrpc/Kconfig b/net/rxrpc/Kconfig index 91b3d52f6f1a..e662f1d07664 100644 --- a/net/rxrpc/Kconfig +++ b/net/rxrpc/Kconfig | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | config AF_RXRPC | 5 | config AF_RXRPC |
6 | tristate "RxRPC session sockets" | 6 | tristate "RxRPC session sockets" |
7 | depends on EXPERIMENTAL | 7 | depends on INET && EXPERIMENTAL |
8 | select KEYS | 8 | select KEYS |
9 | help | 9 | help |
10 | Say Y or M here to include support for RxRPC session sockets (just | 10 | Say Y or M here to include support for RxRPC session sockets (just |
diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c index 4d92d88ff1fc..3c04b00dab74 100644 --- a/net/rxrpc/ar-call.c +++ b/net/rxrpc/ar-call.c | |||
@@ -15,6 +15,25 @@ | |||
15 | #include <net/af_rxrpc.h> | 15 | #include <net/af_rxrpc.h> |
16 | #include "ar-internal.h" | 16 | #include "ar-internal.h" |
17 | 17 | ||
18 | const char *rxrpc_call_states[] = { | ||
19 | [RXRPC_CALL_CLIENT_SEND_REQUEST] = "ClSndReq", | ||
20 | [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl", | ||
21 | [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl", | ||
22 | [RXRPC_CALL_CLIENT_FINAL_ACK] = "ClFnlACK", | ||
23 | [RXRPC_CALL_SERVER_SECURING] = "SvSecure", | ||
24 | [RXRPC_CALL_SERVER_ACCEPTING] = "SvAccept", | ||
25 | [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq", | ||
26 | [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq", | ||
27 | [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl", | ||
28 | [RXRPC_CALL_SERVER_AWAIT_ACK] = "SvAwtACK", | ||
29 | [RXRPC_CALL_COMPLETE] = "Complete", | ||
30 | [RXRPC_CALL_SERVER_BUSY] = "SvBusy ", | ||
31 | [RXRPC_CALL_REMOTELY_ABORTED] = "RmtAbort", | ||
32 | [RXRPC_CALL_LOCALLY_ABORTED] = "LocAbort", | ||
33 | [RXRPC_CALL_NETWORK_ERROR] = "NetError", | ||
34 | [RXRPC_CALL_DEAD] = "Dead ", | ||
35 | }; | ||
36 | |||
18 | struct kmem_cache *rxrpc_call_jar; | 37 | struct kmem_cache *rxrpc_call_jar; |
19 | LIST_HEAD(rxrpc_calls); | 38 | LIST_HEAD(rxrpc_calls); |
20 | DEFINE_RWLOCK(rxrpc_call_lock); | 39 | DEFINE_RWLOCK(rxrpc_call_lock); |
diff --git a/net/rxrpc/ar-proc.c b/net/rxrpc/ar-proc.c index 58f4b4e5cece..1c0be0e77b16 100644 --- a/net/rxrpc/ar-proc.c +++ b/net/rxrpc/ar-proc.c | |||
@@ -25,25 +25,6 @@ static const char *rxrpc_conn_states[] = { | |||
25 | [RXRPC_CONN_NETWORK_ERROR] = "NetError", | 25 | [RXRPC_CONN_NETWORK_ERROR] = "NetError", |
26 | }; | 26 | }; |
27 | 27 | ||
28 | const char *rxrpc_call_states[] = { | ||
29 | [RXRPC_CALL_CLIENT_SEND_REQUEST] = "ClSndReq", | ||
30 | [RXRPC_CALL_CLIENT_AWAIT_REPLY] = "ClAwtRpl", | ||
31 | [RXRPC_CALL_CLIENT_RECV_REPLY] = "ClRcvRpl", | ||
32 | [RXRPC_CALL_CLIENT_FINAL_ACK] = "ClFnlACK", | ||
33 | [RXRPC_CALL_SERVER_SECURING] = "SvSecure", | ||
34 | [RXRPC_CALL_SERVER_ACCEPTING] = "SvAccept", | ||
35 | [RXRPC_CALL_SERVER_RECV_REQUEST] = "SvRcvReq", | ||
36 | [RXRPC_CALL_SERVER_ACK_REQUEST] = "SvAckReq", | ||
37 | [RXRPC_CALL_SERVER_SEND_REPLY] = "SvSndRpl", | ||
38 | [RXRPC_CALL_SERVER_AWAIT_ACK] = "SvAwtACK", | ||
39 | [RXRPC_CALL_COMPLETE] = "Complete", | ||
40 | [RXRPC_CALL_SERVER_BUSY] = "SvBusy ", | ||
41 | [RXRPC_CALL_REMOTELY_ABORTED] = "RmtAbort", | ||
42 | [RXRPC_CALL_LOCALLY_ABORTED] = "LocAbort", | ||
43 | [RXRPC_CALL_NETWORK_ERROR] = "NetError", | ||
44 | [RXRPC_CALL_DEAD] = "Dead ", | ||
45 | }; | ||
46 | |||
47 | /* | 28 | /* |
48 | * generate a list of extant and dead calls in /proc/net/rxrpc_calls | 29 | * generate a list of extant and dead calls in /proc/net/rxrpc_calls |
49 | */ | 30 | */ |
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index 8a72def25a34..5ced62c19c63 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c | |||
@@ -407,27 +407,27 @@ static struct xfrm_algo_desc *xfrm_find_algo( | |||
407 | static int xfrm_alg_id_match(const struct xfrm_algo_desc *entry, | 407 | static int xfrm_alg_id_match(const struct xfrm_algo_desc *entry, |
408 | const void *data) | 408 | const void *data) |
409 | { | 409 | { |
410 | return entry->desc.sadb_alg_id == (int)data; | 410 | return entry->desc.sadb_alg_id == (unsigned long)data; |
411 | } | 411 | } |
412 | 412 | ||
413 | struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id) | 413 | struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id) |
414 | { | 414 | { |
415 | return xfrm_find_algo(&xfrm_aalg_list, xfrm_alg_id_match, | 415 | return xfrm_find_algo(&xfrm_aalg_list, xfrm_alg_id_match, |
416 | (void *)alg_id, 1); | 416 | (void *)(unsigned long)alg_id, 1); |
417 | } | 417 | } |
418 | EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid); | 418 | EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid); |
419 | 419 | ||
420 | struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id) | 420 | struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id) |
421 | { | 421 | { |
422 | return xfrm_find_algo(&xfrm_ealg_list, xfrm_alg_id_match, | 422 | return xfrm_find_algo(&xfrm_ealg_list, xfrm_alg_id_match, |
423 | (void *)alg_id, 1); | 423 | (void *)(unsigned long)alg_id, 1); |
424 | } | 424 | } |
425 | EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid); | 425 | EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid); |
426 | 426 | ||
427 | struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id) | 427 | struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id) |
428 | { | 428 | { |
429 | return xfrm_find_algo(&xfrm_calg_list, xfrm_alg_id_match, | 429 | return xfrm_find_algo(&xfrm_calg_list, xfrm_alg_id_match, |
430 | (void *)alg_id, 1); | 430 | (void *)(unsigned long)alg_id, 1); |
431 | } | 431 | } |
432 | EXPORT_SYMBOL_GPL(xfrm_calg_get_byid); | 432 | EXPORT_SYMBOL_GPL(xfrm_calg_get_byid); |
433 | 433 | ||