diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-20 19:44:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 19:44:00 -0500 |
commit | 6ab33d51713d6d60c7677c0d020910a8cb37e513 (patch) | |
tree | 546c2ff099b2757e75cf34ddace874f1220f740e /net | |
parent | 7be6065b39c3f1cfa796667eac1a2170465acc91 (diff) | |
parent | 13d428afc007fcfcd6deeb215618f54cf9c0cae6 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/ixgbe/ixgbe_main.c
include/net/mac80211.h
net/phonet/af_phonet.c
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 | 41 | ||||
-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, 74 insertions, 178 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 a4f5ad1ab352..4e77914c4d42 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1976,13 +1976,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
1976 | 1976 | ||
1977 | /* make sure that we don't pick a non-existing transmit queue */ | 1977 | /* make sure that we don't pick a non-existing transmit queue */ |
1978 | ntxq = pkt_dev->odev->real_num_tx_queues; | 1978 | ntxq = pkt_dev->odev->real_num_tx_queues; |
1979 | if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | 1979 | |
1980 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " | ||
1981 | "disabled because CPU count (%d) exceeds number " | ||
1982 | "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, | ||
1983 | pkt_dev->odev->name); | ||
1984 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; | ||
1985 | } | ||
1986 | if (ntxq <= pkt_dev->queue_map_min) { | 1980 | if (ntxq <= pkt_dev->queue_map_min) { |
1987 | printk(KERN_WARNING "pktgen: WARNING: Requested " | 1981 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
1988 | "queue_map_min (zero-based) (%d) exceeds valid range " | 1982 | "queue_map_min (zero-based) (%d) exceeds valid range " |
@@ -2205,6 +2199,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev) | |||
2205 | } | 2199 | } |
2206 | pkt_dev->cur_queue_map = t; | 2200 | pkt_dev->cur_queue_map = t; |
2207 | } | 2201 | } |
2202 | pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues; | ||
2208 | } | 2203 | } |
2209 | 2204 | ||
2210 | /* Increment/randomize headers according to flags and current values | 2205 | /* Increment/randomize headers according to flags and current values |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index e3286814c8d9..b1462e8c64cf 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1114,6 +1114,7 @@ int inet_sk_rebuild_header(struct sock *sk) | |||
1114 | }, | 1114 | }, |
1115 | }, | 1115 | }, |
1116 | .proto = sk->sk_protocol, | 1116 | .proto = sk->sk_protocol, |
1117 | .flags = inet_sk_flowi_flags(sk), | ||
1117 | .uli_u = { | 1118 | .uli_u = { |
1118 | .ports = { | 1119 | .ports = { |
1119 | .sport = inet->sport, | 1120 | .sport = inet->sport, |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index ed372f3983e5..ee58bcbc99a5 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1954,13 +1954,14 @@ int __init ip_mr_init(void) | |||
1954 | goto proc_cache_fail; | 1954 | goto proc_cache_fail; |
1955 | #endif | 1955 | #endif |
1956 | return 0; | 1956 | return 0; |
1957 | reg_notif_fail: | ||
1958 | kmem_cache_destroy(mrt_cachep); | ||
1959 | #ifdef CONFIG_PROC_FS | 1957 | #ifdef CONFIG_PROC_FS |
1960 | proc_vif_fail: | ||
1961 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
1962 | proc_cache_fail: | 1958 | proc_cache_fail: |
1963 | proc_net_remove(&init_net, "ip_mr_vif"); | 1959 | proc_net_remove(&init_net, "ip_mr_vif"); |
1960 | proc_vif_fail: | ||
1961 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
1964 | #endif | 1962 | #endif |
1963 | reg_notif_fail: | ||
1964 | del_timer(&ipmr_expire_timer); | ||
1965 | kmem_cache_destroy(mrt_cachep); | ||
1965 | return err; | 1966 | return err; |
1966 | } | 1967 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index fea2d873dd41..da869ce041d9 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -666,6 +666,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
666 | .saddr = saddr, | 666 | .saddr = saddr, |
667 | .tos = tos } }, | 667 | .tos = tos } }, |
668 | .proto = sk->sk_protocol, | 668 | .proto = sk->sk_protocol, |
669 | .flags = inet_sk_flowi_flags(sk), | ||
669 | .uli_u = { .ports = | 670 | .uli_u = { .ports = |
670 | { .sport = inet->sport, | 671 | { .sport = inet->sport, |
671 | .dport = dport } } }; | 672 | .dport = dport } } }; |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index b17377d6f260..363ae258ee1e 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) |
@@ -337,7 +337,7 @@ static struct file_operations ip6mr_mfc_fops = { | |||
337 | .open = ipmr_mfc_open, | 337 | .open = ipmr_mfc_open, |
338 | .read = seq_read, | 338 | .read = seq_read, |
339 | .llseek = seq_lseek, | 339 | .llseek = seq_lseek, |
340 | .release = seq_release, | 340 | .release = seq_release_private, |
341 | }; | 341 | }; |
342 | #endif | 342 | #endif |
343 | 343 | ||
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 b2099306def7..4d76bf25bada 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 62af1d8a8dd2..9d211f12582b 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
@@ -33,8 +33,25 @@ | |||
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 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 | } | ||
38 | 55 | ||
39 | static inline void phonet_proto_put(struct phonet_protocol *pp) | 56 | static inline void phonet_proto_put(struct phonet_protocol *pp) |
40 | { | 57 | { |
@@ -379,10 +396,6 @@ static struct packet_type phonet_packet_type = { | |||
379 | .func = phonet_rcv, | 396 | .func = phonet_rcv, |
380 | }; | 397 | }; |
381 | 398 | ||
382 | /* Transport protocol registration */ | ||
383 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; | ||
384 | static DEFINE_SPINLOCK(proto_tab_lock); | ||
385 | |||
386 | int __init_or_module phonet_proto_register(int protocol, | 399 | int __init_or_module phonet_proto_register(int protocol, |
387 | struct phonet_protocol *pp) | 400 | struct phonet_protocol *pp) |
388 | { | 401 | { |
@@ -416,22 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) | |||
416 | } | 429 | } |
417 | EXPORT_SYMBOL(phonet_proto_unregister); | 430 | EXPORT_SYMBOL(phonet_proto_unregister); |
418 | 431 | ||
419 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
420 | { | ||
421 | struct phonet_protocol *pp; | ||
422 | |||
423 | if (protocol >= PHONET_NPROTO) | ||
424 | return NULL; | ||
425 | |||
426 | spin_lock(&proto_tab_lock); | ||
427 | pp = proto_tab[protocol]; | ||
428 | if (pp && !try_module_get(pp->prot->owner)) | ||
429 | pp = NULL; | ||
430 | spin_unlock(&proto_tab_lock); | ||
431 | |||
432 | return pp; | ||
433 | } | ||
434 | |||
435 | /* Module registration */ | 432 | /* Module registration */ |
436 | static int __init phonet_init(void) | 433 | static int __init phonet_init(void) |
437 | { | 434 | { |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 5bcef13408c8..1ef25e6ee1f9 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -422,6 +422,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) | |||
422 | struct nlattr *nest; | 422 | struct nlattr *nest; |
423 | 423 | ||
424 | nest = nla_nest_start(skb, TCA_STAB); | 424 | nest = nla_nest_start(skb, TCA_STAB); |
425 | if (nest == NULL) | ||
426 | goto nla_put_failure; | ||
425 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); | 427 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); |
426 | nla_nest_end(skb, nest); | 428 | nla_nest_end(skb, nest); |
427 | 429 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 95ab55c064f1..5f5efe4e6072 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 d7128b761c8c..e9d65ea2687e 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1425,8 +1425,8 @@ asmlinkage long sys_listen(int fd, int backlog) | |||
1425 | * clean when we restucture accept also. | 1425 | * clean when we restucture accept also. |
1426 | */ | 1426 | */ |
1427 | 1427 | ||
1428 | long do_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1428 | asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, |
1429 | int __user *upeer_addrlen, int flags) | 1429 | int __user *upeer_addrlen, int flags) |
1430 | { | 1430 | { |
1431 | struct socket *sock, *newsock; | 1431 | struct socket *sock, *newsock; |
1432 | struct file *newfile; | 1432 | struct file *newfile; |
@@ -1509,66 +1509,10 @@ out_fd: | |||
1509 | goto out_put; | 1509 | goto out_put; |
1510 | } | 1510 | } |
1511 | 1511 | ||
1512 | #if 0 | ||
1513 | #ifdef HAVE_SET_RESTORE_SIGMASK | ||
1514 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
1515 | int __user *upeer_addrlen, | ||
1516 | const sigset_t __user *sigmask, | ||
1517 | size_t sigsetsize, int flags) | ||
1518 | { | ||
1519 | sigset_t ksigmask, sigsaved; | ||
1520 | int ret; | ||
1521 | |||
1522 | if (sigmask) { | ||
1523 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
1524 | if (sigsetsize != sizeof(sigset_t)) | ||
1525 | return -EINVAL; | ||
1526 | if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask))) | ||
1527 | return -EFAULT; | ||
1528 | |||
1529 | sigdelsetmask(&ksigmask, sigmask(SIGKILL)|sigmask(SIGSTOP)); | ||
1530 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | ||
1531 | } | ||
1532 | |||
1533 | ret = do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
1534 | |||
1535 | if (ret < 0 && signal_pending(current)) { | ||
1536 | /* | ||
1537 | * Don't restore the signal mask yet. Let do_signal() deliver | ||
1538 | * the signal on the way back to userspace, before the signal | ||
1539 | * mask is restored. | ||
1540 | */ | ||
1541 | if (sigmask) { | ||
1542 | memcpy(¤t->saved_sigmask, &sigsaved, | ||
1543 | sizeof(sigsaved)); | ||
1544 | set_restore_sigmask(); | ||
1545 | } | ||
1546 | } else if (sigmask) | ||
1547 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
1548 | |||
1549 | return ret; | ||
1550 | } | ||
1551 | #else | ||
1552 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
1553 | int __user *upeer_addrlen, | ||
1554 | const sigset_t __user *sigmask, | ||
1555 | size_t sigsetsize, int flags) | ||
1556 | { | ||
1557 | /* The platform does not support restoring the signal mask in the | ||
1558 | * return path. So we do not allow using paccept() with a signal | ||
1559 | * mask. */ | ||
1560 | if (sigmask) | ||
1561 | return -EINVAL; | ||
1562 | |||
1563 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
1564 | } | ||
1565 | #endif | ||
1566 | #endif | ||
1567 | |||
1568 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1512 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, |
1569 | int __user *upeer_addrlen) | 1513 | int __user *upeer_addrlen) |
1570 | { | 1514 | { |
1571 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, 0); | 1515 | return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); |
1572 | } | 1516 | } |
1573 | 1517 | ||
1574 | /* | 1518 | /* |
@@ -2095,7 +2039,7 @@ static const unsigned char nargs[19]={ | |||
2095 | AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), | 2039 | AL(0),AL(3),AL(3),AL(3),AL(2),AL(3), |
2096 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), | 2040 | AL(3),AL(3),AL(4),AL(4),AL(4),AL(6), |
2097 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), | 2041 | AL(6),AL(2),AL(5),AL(5),AL(3),AL(3), |
2098 | AL(6) | 2042 | AL(4) |
2099 | }; | 2043 | }; |
2100 | 2044 | ||
2101 | #undef AL | 2045 | #undef AL |
@@ -2114,7 +2058,7 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
2114 | unsigned long a0, a1; | 2058 | unsigned long a0, a1; |
2115 | int err; | 2059 | int err; |
2116 | 2060 | ||
2117 | if (call < 1 || call > SYS_PACCEPT) | 2061 | if (call < 1 || call > SYS_ACCEPT4) |
2118 | return -EINVAL; | 2062 | return -EINVAL; |
2119 | 2063 | ||
2120 | /* copy_from_user should be SMP safe. */ | 2064 | /* copy_from_user should be SMP safe. */ |
@@ -2142,9 +2086,8 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
2142 | err = sys_listen(a0, a1); | 2086 | err = sys_listen(a0, a1); |
2143 | break; | 2087 | break; |
2144 | case SYS_ACCEPT: | 2088 | case SYS_ACCEPT: |
2145 | err = | 2089 | err = sys_accept4(a0, (struct sockaddr __user *)a1, |
2146 | do_accept(a0, (struct sockaddr __user *)a1, | 2090 | (int __user *)a[2], 0); |
2147 | (int __user *)a[2], 0); | ||
2148 | break; | 2091 | break; |
2149 | case SYS_GETSOCKNAME: | 2092 | case SYS_GETSOCKNAME: |
2150 | err = | 2093 | err = |
@@ -2191,12 +2134,9 @@ asmlinkage long sys_socketcall(int call, unsigned long __user *args) | |||
2191 | case SYS_RECVMSG: | 2134 | case SYS_RECVMSG: |
2192 | err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); | 2135 | err = sys_recvmsg(a0, (struct msghdr __user *)a1, a[2]); |
2193 | break; | 2136 | break; |
2194 | case SYS_PACCEPT: | 2137 | case SYS_ACCEPT4: |
2195 | err = | 2138 | err = sys_accept4(a0, (struct sockaddr __user *)a1, |
2196 | sys_paccept(a0, (struct sockaddr __user *)a1, | 2139 | (int __user *)a[2], a[3]); |
2197 | (int __user *)a[2], | ||
2198 | (const sigset_t __user *) a[3], | ||
2199 | a[4], a[5]); | ||
2200 | break; | 2140 | break; |
2201 | default: | 2141 | default: |
2202 | err = -EINVAL; | 2142 | 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) |