diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-11-21 02:57:04 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-11-21 02:57:04 -0500 |
| commit | fc02e90c34bacd5d7bc77b832c65a8f06e1bd60e (patch) | |
| tree | d870acafa2290779aa7c0594172bf1c691d3e6c0 /net | |
| parent | ec4e0e2fe018992d980910db901637c814575914 (diff) | |
| parent | 13d428afc007fcfcd6deeb215618f54cf9c0cae6 (diff) | |
Merge commit 'v2.6.28-rc6' into sched/core
Diffstat (limited to 'net')
| -rw-r--r-- | net/compat.c | 50 | ||||
| -rw-r--r-- | net/core/pktgen.c | 9 | ||||
| -rw-r--r-- | net/ipv4/af_inet.c | 1 | ||||
| -rw-r--r-- | net/ipv4/ipmr.c | 9 | ||||
| -rw-r--r-- | net/ipv4/udp.c | 1 | ||||
| -rw-r--r-- | net/ipv6/ip6mr.c | 4 | ||||
| -rw-r--r-- | net/ipv6/proc.c | 6 | ||||
| -rw-r--r-- | net/mac80211/mlme.c | 22 | ||||
| -rw-r--r-- | net/phonet/af_phonet.c | 52 | ||||
| -rw-r--r-- | net/sched/sch_api.c | 2 | ||||
| -rw-r--r-- | net/sched/sch_generic.c | 7 | ||||
| -rw-r--r-- | net/socket.c | 80 | ||||
| -rw-r--r-- | net/sunrpc/auth_generic.c | 20 |
13 files changed, 79 insertions, 184 deletions
diff --git a/net/compat.c b/net/compat.c index 6ce1a1cadcc0..a3a2ba0fac08 100644 --- a/net/compat.c +++ b/net/compat.c | |||
| @@ -725,7 +725,7 @@ EXPORT_SYMBOL(compat_mc_getsockopt); | |||
| 725 | static unsigned char nas[19]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), | 725 | static unsigned char nas[19]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), |
| 726 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), | 726 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), |
| 727 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), | 727 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), |
| 728 | AL(6)}; | 728 | AL(4)}; |
| 729 | #undef AL | 729 | #undef AL |
| 730 | 730 | ||
| 731 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags) | 731 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned flags) |
| @@ -738,52 +738,13 @@ asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, uns | |||
| 738 | return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | 738 | return sys_recvmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); |
| 739 | } | 739 | } |
| 740 | 740 | ||
| 741 | asmlinkage long compat_sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
| 742 | int __user *upeer_addrlen, | ||
| 743 | const compat_sigset_t __user *sigmask, | ||
| 744 | compat_size_t sigsetsize, int flags) | ||
| 745 | { | ||
| 746 | compat_sigset_t ss32; | ||
| 747 | sigset_t ksigmask, sigsaved; | ||
| 748 | int ret; | ||
| 749 | |||
| 750 | if (sigmask) { | ||
| 751 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
| 752 | return -EINVAL; | ||
| 753 | if (copy_from_user(&ss32, sigmask, sizeof(ss32))) | ||
| 754 | return -EFAULT; | ||
| 755 | sigset_from_compat(&ksigmask, &ss32); | ||
| 756 | |||
| 757 | sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
| 758 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | ||
| 759 | } | ||
| 760 | |||
| 761 | ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
| 762 | |||
| 763 | if (ret == -ERESTARTNOHAND) { | ||
| 764 | /* | ||
| 765 | * Don't restore the signal mask yet. Let do_signal() deliver | ||
| 766 | * the signal on the way back to userspace, before the signal | ||
| 767 | * mask is restored. | ||
| 768 | */ | ||
| 769 | if (sigmask) { | ||
| 770 | memcpy(¤t->saved_sigmask, &sigsaved, | ||
| 771 | sizeof(sigsaved)); | ||
| 772 | set_restore_sigmask(); | ||
| 773 | } | ||
| 774 | } else if (sigmask) | ||
| 775 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
| 776 | |||
| 777 | return ret; | ||
| 778 | } | ||
| 779 | |||
| 780 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | 741 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args) |
| 781 | { | 742 | { |
| 782 | int ret; | 743 | int ret; |
| 783 | u32 a[6]; | 744 | u32 a[6]; |
| 784 | u32 a0, a1; | 745 | u32 a0, a1; |
| 785 | 746 | ||
| 786 | if (call < SYS_SOCKET || call > SYS_PACCEPT) | 747 | if (call < SYS_SOCKET || call > SYS_ACCEPT4) |
| 787 | return -EINVAL; | 748 | return -EINVAL; |
| 788 | if (copy_from_user(a, args, nas[call])) | 749 | if (copy_from_user(a, args, nas[call])) |
| 789 | return -EFAULT; | 750 | return -EFAULT; |
| @@ -804,7 +765,7 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | |||
| 804 | ret = sys_listen(a0, a1); | 765 | ret = sys_listen(a0, a1); |
| 805 | break; | 766 | break; |
| 806 | case SYS_ACCEPT: | 767 | case SYS_ACCEPT: |
| 807 | ret = do_accept(a0, compat_ptr(a1), compat_ptr(a[2]), 0); | 768 | ret = sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), 0); |
| 808 | break; | 769 | break; |
| 809 | case SYS_GETSOCKNAME: | 770 | case SYS_GETSOCKNAME: |
| 810 | ret = sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2])); | 771 | ret = sys_getsockname(a0, compat_ptr(a1), compat_ptr(a[2])); |
| @@ -844,9 +805,8 @@ asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | |||
| 844 | case SYS_RECVMSG: | 805 | case SYS_RECVMSG: |
| 845 | ret = compat_sys_recvmsg(a0, compat_ptr(a1), a[2]); | 806 | ret = compat_sys_recvmsg(a0, compat_ptr(a1), a[2]); |
| 846 | break; | 807 | break; |
| 847 | case SYS_PACCEPT: | 808 | case SYS_ACCEPT4: |
| 848 | ret = compat_sys_paccept(a0, compat_ptr(a1), compat_ptr(a[2]), | 809 | ret = sys_accept4(a0, compat_ptr(a1), compat_ptr(a[2]), a[3]); |
| 849 | compat_ptr(a[3]), a[4], a[5]); | ||
| 850 | break; | 810 | break; |
| 851 | default: | 811 | default: |
| 852 | ret = -EINVAL; | 812 | ret = -EINVAL; |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index a47f5bad110d..8997e912aaaf 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -1973,13 +1973,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
| 1973 | 1973 | ||
| 1974 | /* make sure that we don't pick a non-existing transmit queue */ | 1974 | /* make sure that we don't pick a non-existing transmit queue */ |
| 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; | 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; |
| 1976 | if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | 1976 | |
| 1977 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " | ||
| 1978 | "disabled because CPU count (%d) exceeds number " | ||
| 1979 | "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, | ||
| 1980 | pkt_dev->odev->name); | ||
| 1981 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; | ||
| 1982 | } | ||
| 1983 | if (ntxq <= pkt_dev->queue_map_min) { | 1977 | if (ntxq <= pkt_dev->queue_map_min) { |
| 1984 | printk(KERN_WARNING "pktgen: WARNING: Requested " | 1978 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
| 1985 | "queue_map_min (zero-based) (%d) exceeds valid range " | 1979 | "queue_map_min (zero-based) (%d) exceeds valid range " |
| @@ -2202,6 +2196,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev) | |||
| 2202 | } | 2196 | } |
| 2203 | pkt_dev->cur_queue_map = t; | 2197 | pkt_dev->cur_queue_map = t; |
| 2204 | } | 2198 | } |
| 2199 | pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues; | ||
| 2205 | } | 2200 | } |
| 2206 | 2201 | ||
| 2207 | /* Increment/randomize headers according to flags and current values | 2202 | /* Increment/randomize headers according to flags and current values |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1fbff5fa4241..1aa2dc9e380e 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -1117,6 +1117,7 @@ int inet_sk_rebuild_header(struct sock *sk) | |||
| 1117 | }, | 1117 | }, |
| 1118 | }, | 1118 | }, |
| 1119 | .proto = sk->sk_protocol, | 1119 | .proto = sk->sk_protocol, |
| 1120 | .flags = inet_sk_flowi_flags(sk), | ||
| 1120 | .uli_u = { | 1121 | .uli_u = { |
| 1121 | .ports = { | 1122 | .ports = { |
| 1122 | .sport = inet->sport, | 1123 | .sport = inet->sport, |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index b42e082cc170..25924b1eb2ef 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
| @@ -1945,13 +1945,14 @@ int __init ip_mr_init(void) | |||
| 1945 | goto proc_cache_fail; | 1945 | goto proc_cache_fail; |
| 1946 | #endif | 1946 | #endif |
| 1947 | return 0; | 1947 | return 0; |
| 1948 | reg_notif_fail: | ||
| 1949 | kmem_cache_destroy(mrt_cachep); | ||
| 1950 | #ifdef CONFIG_PROC_FS | 1948 | #ifdef CONFIG_PROC_FS |
| 1951 | proc_vif_fail: | ||
| 1952 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
| 1953 | proc_cache_fail: | 1949 | proc_cache_fail: |
| 1954 | proc_net_remove(&init_net, "ip_mr_vif"); | 1950 | proc_net_remove(&init_net, "ip_mr_vif"); |
| 1951 | proc_vif_fail: | ||
| 1952 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
| 1955 | #endif | 1953 | #endif |
| 1954 | reg_notif_fail: | ||
| 1955 | del_timer(&ipmr_expire_timer); | ||
| 1956 | kmem_cache_destroy(mrt_cachep); | ||
| 1956 | return err; | 1957 | return err; |
| 1957 | } | 1958 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index cf02701ced48..98c1fd09be88 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 633 | .saddr = saddr, | 633 | .saddr = saddr, |
| 634 | .tos = tos } }, | 634 | .tos = tos } }, |
| 635 | .proto = sk->sk_protocol, | 635 | .proto = sk->sk_protocol, |
| 636 | .flags = inet_sk_flowi_flags(sk), | ||
| 636 | .uli_u = { .ports = | 637 | .uli_u = { .ports = |
| 637 | { .sport = inet->sport, | 638 | { .sport = inet->sport, |
| 638 | .dport = dport } } }; | 639 | .dport = dport } } }; |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 52a7eb0e2c2c..0524769632e7 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
| @@ -224,7 +224,7 @@ static struct file_operations ip6mr_vif_fops = { | |||
| 224 | .open = ip6mr_vif_open, | 224 | .open = ip6mr_vif_open, |
| 225 | .read = seq_read, | 225 | .read = seq_read, |
| 226 | .llseek = seq_lseek, | 226 | .llseek = seq_lseek, |
| 227 | .release = seq_release, | 227 | .release = seq_release_private, |
| 228 | }; | 228 | }; |
| 229 | 229 | ||
| 230 | static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) | 230 | static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) |
| @@ -338,7 +338,7 @@ static struct file_operations ip6mr_mfc_fops = { | |||
| 338 | .open = ipmr_mfc_open, | 338 | .open = ipmr_mfc_open, |
| 339 | .read = seq_read, | 339 | .read = seq_read, |
| 340 | .llseek = seq_lseek, | 340 | .llseek = seq_lseek, |
| 341 | .release = seq_release, | 341 | .release = seq_release_private, |
| 342 | }; | 342 | }; |
| 343 | #endif | 343 | #endif |
| 344 | 344 | ||
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 07f0b76e7427..97c17fdd6f75 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
| @@ -132,7 +132,7 @@ static struct snmp_mib snmp6_udplite6_list[] = { | |||
| 132 | 132 | ||
| 133 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | 133 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) |
| 134 | { | 134 | { |
| 135 | static char name[32]; | 135 | char name[32]; |
| 136 | int i; | 136 | int i; |
| 137 | 137 | ||
| 138 | /* print by name -- deprecated items */ | 138 | /* print by name -- deprecated items */ |
| @@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
| 144 | p = icmp6type2name[icmptype]; | 144 | p = icmp6type2name[icmptype]; |
| 145 | if (!p) /* don't print un-named types here */ | 145 | if (!p) /* don't print un-named types here */ |
| 146 | continue; | 146 | continue; |
| 147 | (void) snprintf(name, sizeof(name)-1, "Icmp6%s%s", | 147 | snprintf(name, sizeof(name), "Icmp6%s%s", |
| 148 | i & 0x100 ? "Out" : "In", p); | 148 | i & 0x100 ? "Out" : "In", p); |
| 149 | seq_printf(seq, "%-32s\t%lu\n", name, | 149 | seq_printf(seq, "%-32s\t%lu\n", name, |
| 150 | snmp_fold_field(mib, i)); | 150 | snmp_fold_field(mib, i)); |
| @@ -157,7 +157,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
| 157 | val = snmp_fold_field(mib, i); | 157 | val = snmp_fold_field(mib, i); |
| 158 | if (!val) | 158 | if (!val) |
| 159 | continue; | 159 | continue; |
| 160 | (void) snprintf(name, sizeof(name)-1, "Icmp6%sType%u", | 160 | snprintf(name, sizeof(name), "Icmp6%sType%u", |
| 161 | i & 0x100 ? "Out" : "In", i & 0xff); | 161 | i & 0x100 ? "Out" : "In", i & 0xff); |
| 162 | seq_printf(seq, "%-32s\t%lu\n", name, val); | 162 | seq_printf(seq, "%-32s\t%lu\n", name, val); |
| 163 | } | 163 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 14d165f0df75..409bb7716236 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -2560,25 +2560,3 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local) | |||
| 2560 | ieee80211_restart_sta_timer(sdata); | 2560 | ieee80211_restart_sta_timer(sdata); |
| 2561 | rcu_read_unlock(); | 2561 | rcu_read_unlock(); |
| 2562 | } | 2562 | } |
| 2563 | |||
| 2564 | /* driver notification call */ | ||
| 2565 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | ||
| 2566 | enum ieee80211_notification_types notif_type) | ||
| 2567 | { | ||
| 2568 | struct ieee80211_local *local = hw_to_local(hw); | ||
| 2569 | struct ieee80211_sub_if_data *sdata; | ||
| 2570 | |||
| 2571 | switch (notif_type) { | ||
| 2572 | case IEEE80211_NOTIFY_RE_ASSOC: | ||
| 2573 | rtnl_lock(); | ||
| 2574 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
| 2575 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | ||
| 2576 | continue; | ||
| 2577 | |||
| 2578 | ieee80211_sta_req_auth(sdata, &sdata->u.sta); | ||
| 2579 | } | ||
| 2580 | rtnl_unlock(); | ||
| 2581 | break; | ||
| 2582 | } | ||
| 2583 | } | ||
| 2584 | EXPORT_SYMBOL(ieee80211_notify_mac); | ||
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index 7ab30f668b5a..9d211f12582b 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
| @@ -33,9 +33,30 @@ | |||
| 33 | #include <net/phonet/phonet.h> | 33 | #include <net/phonet/phonet.h> |
| 34 | #include <net/phonet/pn_dev.h> | 34 | #include <net/phonet/pn_dev.h> |
| 35 | 35 | ||
| 36 | static struct net_proto_family phonet_proto_family; | 36 | /* Transport protocol registration */ |
| 37 | static struct phonet_protocol *phonet_proto_get(int protocol); | 37 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; |
| 38 | static inline void phonet_proto_put(struct phonet_protocol *pp); | 38 | static DEFINE_SPINLOCK(proto_tab_lock); |
| 39 | |||
| 40 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
| 41 | { | ||
| 42 | struct phonet_protocol *pp; | ||
| 43 | |||
| 44 | if (protocol >= PHONET_NPROTO) | ||
| 45 | return NULL; | ||
| 46 | |||
| 47 | spin_lock(&proto_tab_lock); | ||
| 48 | pp = proto_tab[protocol]; | ||
| 49 | if (pp && !try_module_get(pp->prot->owner)) | ||
| 50 | pp = NULL; | ||
| 51 | spin_unlock(&proto_tab_lock); | ||
| 52 | |||
| 53 | return pp; | ||
| 54 | } | ||
| 55 | |||
| 56 | static inline void phonet_proto_put(struct phonet_protocol *pp) | ||
| 57 | { | ||
| 58 | module_put(pp->prot->owner); | ||
| 59 | } | ||
| 39 | 60 | ||
| 40 | /* protocol family functions */ | 61 | /* protocol family functions */ |
| 41 | 62 | ||
| @@ -375,10 +396,6 @@ static struct packet_type phonet_packet_type = { | |||
| 375 | .func = phonet_rcv, | 396 | .func = phonet_rcv, |
| 376 | }; | 397 | }; |
| 377 | 398 | ||
| 378 | /* Transport protocol registration */ | ||
| 379 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; | ||
| 380 | static DEFINE_SPINLOCK(proto_tab_lock); | ||
| 381 | |||
| 382 | int __init_or_module phonet_proto_register(int protocol, | 399 | int __init_or_module phonet_proto_register(int protocol, |
| 383 | struct phonet_protocol *pp) | 400 | struct phonet_protocol *pp) |
| 384 | { | 401 | { |
| @@ -412,27 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) | |||
| 412 | } | 429 | } |
| 413 | EXPORT_SYMBOL(phonet_proto_unregister); | 430 | EXPORT_SYMBOL(phonet_proto_unregister); |
| 414 | 431 | ||
| 415 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
| 416 | { | ||
| 417 | struct phonet_protocol *pp; | ||
| 418 | |||
| 419 | if (protocol >= PHONET_NPROTO) | ||
| 420 | return NULL; | ||
| 421 | |||
| 422 | spin_lock(&proto_tab_lock); | ||
| 423 | pp = proto_tab[protocol]; | ||
| 424 | if (pp && !try_module_get(pp->prot->owner)) | ||
| 425 | pp = NULL; | ||
| 426 | spin_unlock(&proto_tab_lock); | ||
| 427 | |||
| 428 | return pp; | ||
| 429 | } | ||
| 430 | |||
| 431 | static inline void phonet_proto_put(struct phonet_protocol *pp) | ||
| 432 | { | ||
| 433 | module_put(pp->prot->owner); | ||
| 434 | } | ||
| 435 | |||
| 436 | /* Module registration */ | 432 | /* Module registration */ |
| 437 | static int __init phonet_init(void) | 433 | static int __init phonet_init(void) |
| 438 | { | 434 | { |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b16ad2972c6b..6ab4a2f92ca0 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
| @@ -417,6 +417,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) | |||
| 417 | struct nlattr *nest; | 417 | struct nlattr *nest; |
| 418 | 418 | ||
| 419 | nest = nla_nest_start(skb, TCA_STAB); | 419 | nest = nla_nest_start(skb, TCA_STAB); |
| 420 | if (nest == NULL) | ||
| 421 | goto nla_put_failure; | ||
| 420 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); | 422 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); |
| 421 | nla_nest_end(skb, nest); | 423 | nla_nest_end(skb, nest); |
| 422 | 424 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 93cd30ce6501..cdcd16fcfeda 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
| @@ -270,6 +270,8 @@ static void dev_watchdog_down(struct net_device *dev) | |||
| 270 | void netif_carrier_on(struct net_device *dev) | 270 | void netif_carrier_on(struct net_device *dev) |
| 271 | { | 271 | { |
| 272 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { | 272 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { |
| 273 | if (dev->reg_state == NETREG_UNINITIALIZED) | ||
| 274 | return; | ||
| 273 | linkwatch_fire_event(dev); | 275 | linkwatch_fire_event(dev); |
| 274 | if (netif_running(dev)) | 276 | if (netif_running(dev)) |
| 275 | __netdev_watchdog_up(dev); | 277 | __netdev_watchdog_up(dev); |
| @@ -285,8 +287,11 @@ EXPORT_SYMBOL(netif_carrier_on); | |||
| 285 | */ | 287 | */ |
| 286 | void netif_carrier_off(struct net_device *dev) | 288 | void netif_carrier_off(struct net_device *dev) |
| 287 | { | 289 | { |
| 288 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) | 290 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) { |
| 291 | if (dev->reg_state == NETREG_UNINITIALIZED) | ||
| 292 | return; | ||
| 289 | linkwatch_fire_event(dev); | 293 | linkwatch_fire_event(dev); |
| 294 | } | ||
| 290 | } | 295 | } |
| 291 | EXPORT_SYMBOL(netif_carrier_off); | 296 | EXPORT_SYMBOL(netif_carrier_off); |
| 292 | 297 | ||
diff --git a/net/socket.c b/net/socket.c index 57550c3bcabe..92764d836891 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -1426,8 +1426,8 @@ asmlinkage long sys_listen(int fd, int backlog) | |||
| 1426 | * clean when we restucture accept also. | 1426 | * clean when we restucture accept also. |
| 1427 | */ | 1427 | */ |
| 1428 | 1428 | ||
| 1429 | long do_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1429 | asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, |
| 1430 | int __user *upeer_addrlen, int flags) | 1430 | int __user *upeer_addrlen, int flags) |
| 1431 | { | 1431 | { |
| 1432 | struct socket *sock, *newsock; | 1432 | struct socket *sock, *newsock; |
| 1433 | struct file *newfile; | 1433 | struct file *newfile; |
| @@ -1510,66 +1510,10 @@ out_fd: | |||
| 1510 | goto out_put; | 1510 | goto out_put; |
| 1511 | } | 1511 | } |
| 1512 | 1512 | ||
| 1513 | #if 0 | ||
| 1514 | #ifdef HAVE_SET_RESTORE_SIGMASK | ||
| 1515 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
| 1516 | int __user *upeer_addrlen, | ||
| 1517 | const sigset_t __user *sigmask, | ||
| 1518 | size_t sigsetsize, int flags) | ||
| 1519 | { | ||
| 1520 | sigset_t ksigmask, sigsaved; | ||
| 1521 | int ret; | ||
| 1522 | |||
| 1523 | if (sigmask) { | ||
| 1524 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
| 1525 | if (sigsetsize != sizeof(sigset_t)) | ||
| 1526 | return -EINVAL; | ||
| 1527 | if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask))) | ||
| 1528 | return -EFAULT; | ||
| 1529 | |||
| 1530 | sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
| 1531 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | ||
| 1532 | } | ||
| 1533 | |||
| 1534 | ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
| 1535 | |||
| 1536 | if (ret < 0 && signal_pending(current)) { | ||
| 1537 | /* | ||
| 1538 | * Don't restore the signal mask yet. Let do_signal() deliver | ||
| 1539 | * the signal on the way back to userspace, before the signal | ||
| 1540 | * mask is restored. | ||
| 1541 | */ | ||
| 1542 | if (sigmask) { | ||
| 1543 | memcpy(¤t->saved_sigmask, &sigsaved, | ||
| 1544 | sizeof(sigsaved)); | ||
| 1545 | set_restore_sigmask(); | ||
| 1546 | } | ||
| 1547 | } else if (sigmask) | ||
| 1548 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
| 1549 | |||
| 1550 | return ret; | ||
| 1551 | } | ||
| 1552 | #else | ||
| 1553 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
| 1554 | int __user *upeer_addrlen, | ||
| 1555 | const sigset_t __user *sigmask, | ||
| 1556 | size_t sigsetsize, int flags) | ||
| 1557 | { | ||
| 1558 | /* The platform does not support restoring the signal mask in the | ||
| 1559 | * return path. So we do not allow using paccept() with a signal | ||
| 1560 | * mask. */ | ||
| 1561 | if (sigmask) | ||
| 1562 | return -EINVAL; | ||
| 1563 | |||
| 1564 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
| 1565 | } | ||
| 1566 | #endif | ||
| 1567 | #endif | ||
| 1568 | |||
| 1569 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1513 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, |
| 1570 | int __user *upeer_addrlen) | 1514 | int __user *upeer_addrlen) |
| 1571 | { | 1515 | { |
| 1572 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, 0); | 1516 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); |
| 1573 | } | 1517 | } |
| 1574 | 1518 | ||
| 1575 | /* | 1519 | /* |
| @@ -2096,7 +2040,7 @@ static const unsigned char nargs[19]={ | |||
| 2096 | AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), | 2040 | AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), |
| 2097 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), | 2041 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), |
| 2098 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), | 2042 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), |
| 2099 | AL(6) | 2043 | AL(4) |
| 2100 | }; | 2044 | }; |
| 2101 | 2045 | ||
| 2102 | #undef AL | 2046 | #undef AL |
| @@ -2115,7 +2059,7 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
| 2115 | unsigned long a0, a1; | 2059 | unsigned long a0, a1; |
| 2116 | int err; | 2060 | int err; |
| 2117 | 2061 | ||
| 2118 | if (call < 1 || call > SYS_PACCEPT) | 2062 | if (call < 1 || call > SYS_ACCEPT4) |
| 2119 | return -EINVAL; | 2063 | return -EINVAL; |
| 2120 | 2064 | ||
| 2121 | /* copy_from_user should be SMP safe. */ | 2065 | /* copy_from_user should be SMP safe. */ |
| @@ -2143,9 +2087,8 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
| 2143 | err = sys_listen(a0, a1); | 2087 | err = sys_listen(a0, a1); |
| 2144 | break; | 2088 | break; |
| 2145 | case SYS_ACCEPT: | 2089 | case SYS_ACCEPT: |
| 2146 | err = | 2090 | err = sys_accept4(a0, (struct sockaddr __user *)a1, |
| 2147 | do_accept(a0, (struct sockaddr __user *)a1, | 2091 | (int __user *)a[2], 0); |
| 2148 | (int __user *)a[2], 0); | ||
| 2149 | break; | 2092 | break; |
| 2150 | case SYS_GETSOCKNAME: | 2093 | case SYS_GETSOCKNAME: |
| 2151 | err = | 2094 | err = |
| @@ -2192,12 +2135,9 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
| 2192 | case SYS_RECVMSG: | 2135 | case SYS_RECVMSG: |
| 2193 | err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); | 2136 | err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); |
| 2194 | break; | 2137 | break; |
| 2195 | case SYS_PACCEPT: | 2138 | case SYS_ACCEPT4: |
| 2196 | err = | 2139 | err = sys_accept4(a0, (struct sockaddr __user *)a1, |
| 2197 | sys_paccept(a0, (struct sockaddr __user *)a1, | 2140 | (int __user *)a[2], a[3]); |
| 2198 | (int __user *)a[2], | ||
| 2199 | (const sigset_t __user *) a[3], | ||
| 2200 | a[4], a[5]); | ||
| 2201 | break; | 2141 | break; |
| 2202 | default: | 2142 | default: |
| 2203 | err = -EINVAL; | 2143 | err = -EINVAL; |
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index 744b79fdcb19..4028502f0528 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
| @@ -133,13 +133,29 @@ static int | |||
| 133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) | 133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) |
| 134 | { | 134 | { |
| 135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); | 135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); |
| 136 | int i; | ||
| 136 | 137 | ||
| 137 | if (gcred->acred.uid != acred->uid || | 138 | if (gcred->acred.uid != acred->uid || |
| 138 | gcred->acred.gid != acred->gid || | 139 | gcred->acred.gid != acred->gid || |
| 139 | gcred->acred.group_info != acred->group_info || | ||
| 140 | gcred->acred.machine_cred != acred->machine_cred) | 140 | gcred->acred.machine_cred != acred->machine_cred) |
| 141 | return 0; | 141 | goto out_nomatch; |
| 142 | |||
| 143 | /* Optimisation in the case where pointers are identical... */ | ||
| 144 | if (gcred->acred.group_info == acred->group_info) | ||
| 145 | goto out_match; | ||
| 146 | |||
| 147 | /* Slow path... */ | ||
| 148 | if (gcred->acred.group_info->ngroups != acred->group_info->ngroups) | ||
| 149 | goto out_nomatch; | ||
| 150 | for (i = 0; i < gcred->acred.group_info->ngroups; i++) { | ||
| 151 | if (GROUP_AT(gcred->acred.group_info, i) != | ||
| 152 | GROUP_AT(acred->group_info, i)) | ||
| 153 | goto out_nomatch; | ||
| 154 | } | ||
| 155 | out_match: | ||
| 142 | return 1; | 156 | return 1; |
| 157 | out_nomatch: | ||
| 158 | return 0; | ||
| 143 | } | 159 | } |
| 144 | 160 | ||
| 145 | void __init rpc_init_generic_auth(void) | 161 | void __init rpc_init_generic_auth(void) |
