Commit 50441791 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/gregkh/linux/linus-2.5

into penguin.transmeta.com:/home/torvalds/v2.5/linux
parents 66731c77 6bd4301a
......@@ -3027,8 +3027,8 @@ E: torvalds@transmeta.com
W: http://www.cs.helsinki.fi/Linus.Torvalds
P: 1024/A86B35C5 96 54 50 29 EC 11 44 7A BE 67 3C 24 03 13 62 C8
D: Original kernel hacker
S: 1050 Woodduck Avenue
S: Santa Clara, California 95051
S: 3990 Freedom Circle
S: Santa Clara, California 95054
S: USA
N: Marcelo W. Tosatti
......
......@@ -440,5 +440,19 @@ config ATM_FORE200E
default m if ATM_FORE200E_MAYBE!=y
default y if ATM_FORE200E_MAYBE=y
config ATM_HE
tristate "ForeRunner HE Series"
depends on PCI && ATM
help
This is a driver for the Marconi ForeRunner HE-series ATM adapter
cards. It simultaneously supports the 155 and 622 versions.
config ATM_HE_USE_SUNI
bool "Use S/UNI PHY driver"
depends on ATM_HE
help
Support for the S/UNI-Ultra and S/UNI-622 found in the ForeRunner
HE cards. This driver provides carrier detection some statistics.
endmenu
......@@ -49,6 +49,10 @@ ifeq ($(CONFIG_ATM_FORE200E_SBA),y)
CONFIG_ATM_FORE200E_SBA_FW := $(obj)/sba200e_ecd.bin2
endif
endif
obj-$(CONFIG_ATM_HE) += he.o
ifeq ($(CONFIG_ATM_HE_USE_SUNI),y)
obj-$(CONFIG_ATM_HE) += suni.o
endif
# FORE Systems 200E-series firmware magic
$(obj)/fore200e_pca_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_PCA_FW)) \
......
This diff is collapsed.
This diff is collapsed.
/* atm_he.h */
#ifndef LINUX_ATM_HE_H
#define LINUX_ATM_HE_H
#include <linux/atmioc.h>
#define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc)
#define HE_REGTYPE_PCI 1
#define HE_REGTYPE_RCM 2
#define HE_REGTYPE_TCM 3
#define HE_REGTYPE_MBOX 4
struct he_ioctl_reg {
unsigned addr, val;
char type;
};
#endif /* LINUX_ATM_HE_H */
#ifndef _LINUX_ATMBR2684_H
#define _LINUX_ATMBR2684_H
#include <linux/atm.h>
#include <linux/if.h> /* For IFNAMSIZ */
/*
* Type of media we're bridging (ethernet, token ring, etc) Currently only
* ethernet is supported
*/
#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
#define BR2684_MEDIA_802_4 (1) /* 802.4 */
#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
#define BR2684_MEDIA_FDDI (3)
#define BR2684_MEDIA_802_6 (4) /* 802.6 */
/*
* Is there FCS inbound on this VC? This currently isn't supported.
*/
#define BR2684_FCSIN_NO (0)
#define BR2684_FCSIN_IGNORE (1)
#define BR2684_FCSIN_VERIFY (2)
/*
* Is there FCS outbound on this VC? This currently isn't supported.
*/
#define BR2684_FCSOUT_NO (0)
#define BR2684_FCSOUT_SENDZERO (1)
#define BR2684_FCSOUT_GENERATE (2)
/*
* Does this VC include LLC encapsulation?
*/
#define BR2684_ENCAPS_VC (0) /* VC-mux */
#define BR2684_ENCAPS_LLC (1)
#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
/*
* This is for the ATM_NEWBACKENDIF call - these are like socket families:
* the first element of the structure is the backend number and the rest
* is per-backend specific
*/
struct atm_newif_br2684 {
atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
int media; /* BR2684_MEDIA_* */
char ifname[IFNAMSIZ];
int mtu;
};
/*
* This structure is used to specify a br2684 interface - either by a
* positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
*/
#define BR2684_FIND_BYNOTHING (0)
#define BR2684_FIND_BYNUM (1)
#define BR2684_FIND_BYIFNAME (2)
struct br2684_if_spec {
int method; /* BR2684_FIND_* */
union {
char ifname[IFNAMSIZ];
int devnum;
} spec;
};
/*
* This is for the ATM_SETBACKEND call - these are like socket families:
* the first element of the structure is the backend number and the rest
* is per-backend specific
*/
struct atm_backend_br2684 {
atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
struct br2684_if_spec ifspec;
int fcs_in; /* BR2684_FCSIN_* */
int fcs_out; /* BR2684_FCSOUT_* */
int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
int encaps; /* BR2684_ENCAPS_* */
int has_vpiid; /* 1: use vpn_id - Unsupported */
__u8 vpn_id[7];
int send_padding; /* unsupported */
int min_size; /* we will pad smaller packets than this */
};
/*
* The BR2684_SETFILT ioctl is an experimental mechanism for folks
* terminating a large number of IP-only vcc's. When netfilter allows
* efficient per-if in/out filters, this support will be removed
*/
struct br2684_filter {
__u32 prefix; /* network byte order */
__u32 netmask; /* 0 = disable filter */
};
struct br2684_filter_set {
struct br2684_if_spec ifspec;
struct br2684_filter filter;
};
#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
struct br2684_filter_set)
#endif /* _LINUX_ATMBR2684_H */
......@@ -96,6 +96,8 @@ struct atm_dev_stats {
/* enable or disable single-copy */
#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
/* set backend handler */
#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
/* use backend to make new if */
/*
* These are backend handkers that can be set via the ATM_SETBACKEND call
......@@ -104,7 +106,7 @@ struct atm_dev_stats {
*/
#define ATM_BACKEND_RAW 0
#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
#define ATM_BACKEND_BR_2684 2 /* Bridged RFC1483/2684 */
#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
/* for ATM_GETTYPE */
#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
......@@ -304,9 +306,6 @@ struct atm_vcc {
struct sockaddr_atmsvc local;
struct sockaddr_atmsvc remote;
void (*callback)(struct atm_vcc *vcc);
struct sk_buff_head listenq;
int backlog_quota; /* number of connection requests we */
/* can still accept */
int reply; /* also used by ATMTCP */
/* Multipoint part ------------------------------------------------- */
struct atm_vcc *session; /* session VCC descriptor */
......
......@@ -78,7 +78,7 @@ struct rtattr
/******************************************************************************
* Definitions used in routing table administation.
* Definitions used in routing table administration.
****/
struct rtmsg
......@@ -129,14 +129,14 @@ enum
#define RTPROT_STATIC 4 /* Route installed by administrator */
/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
they just passed from user and back as is.
they are just passed from user and back as is.
It will be used by hypothetical multiple routing daemons.
Note that protocol values should be standardized in order to
avoid conflicts.
*/
#define RTPROT_GATED 8 /* Apparently, GateD */
#define RTPROT_RA 9 /* RDISC/ND router advertisments */
#define RTPROT_RA 9 /* RDISC/ND router advertisements */
#define RTPROT_MRT 10 /* Merit MRT */
#define RTPROT_ZEBRA 11 /* Zebra */
#define RTPROT_BIRD 12 /* BIRD */
......@@ -210,8 +210,8 @@ enum rtattr_type_t
/* RTM_MULTIPATH --- array of struct rtnexthop.
*
* "struct rtnexthop" describres all necessary nexthop information,
* i.e. parameters of path to a destination via this nextop.
* "struct rtnexthop" describes all necessary nexthop information,
* i.e. parameters of path to a destination via this nexthop.
*
* At the moment it is impossible to set different prefsrc, mtu, window
* and rtt for different paths from multipath.
......@@ -485,7 +485,7 @@ enum
Comments:
- Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
- If neiher of these three flags are set;
- If neither of these three flags are set;
the interface is NBMA.
- IFF_MULTICAST does not mean anything special:
......
......@@ -266,6 +266,23 @@ config ATM_MPOA
subnetwork boundaries. These shortcut connections bypass routers
enhancing overall network performance.
config ATM_BR2684
tristate "RFC1483/2684 Bridged protocols"
depends on ATM && INET
help
ATM PVCs can carry ethernet PDUs according to rfc2684 (formerly 1483)
This device will act like an ethernet from the kernels point of view,
with the traffic being carried by ATM PVCs (currently 1 PVC/device).
This is sometimes used over DSL lines. If in doubt, say N.
config ATM_BR2684_IPFILTER
bool "Per-VC IP filter kludge"
depends on ATM_BR2684
help
This is an experimental mechanism for users who need to terminating a
large number of IP-only vcc's. Do not enable this unless you are sure
you know what you are doing.
config VLAN_8021Q
tristate "802.1Q VLAN Support"
......
......@@ -7,6 +7,7 @@ mpoa-objs := mpc.o mpoa_caches.o mpoa_proc.o
obj-$(CONFIG_ATM) := addr.o pvc.o signaling.o svc.o common.o atm_misc.o raw.o resources.o
obj-$(CONFIG_ATM_CLIP) += clip.o ipcommon.o
obj-$(CONFIG_ATM_BR2684) += br2684.o ipcommon.o
obj-$(CONFIG_NET_SCH_ATM) += ipcommon.o
obj-$(CONFIG_PROC_FS) += proc.o
......
This diff is collapsed.
......@@ -127,6 +127,8 @@ static void idle_timer_check(unsigned long dummy)
struct atmarp_entry *entry = NEIGH2ENTRY(n);
struct clip_vcc *clip_vcc;
write_lock(&n->lock);
for (clip_vcc = entry->vccs; clip_vcc;
clip_vcc = clip_vcc->next)
if (clip_vcc->idle_timeout &&
......@@ -141,6 +143,7 @@ static void idle_timer_check(unsigned long dummy)
if (entry->vccs ||
time_before(jiffies, entry->expires)) {
np = &n->next;
write_unlock(&n->lock);
continue;
}
if (atomic_read(&n->refcnt) > 1) {
......@@ -152,11 +155,13 @@ static void idle_timer_check(unsigned long dummy)
NULL)
dev_kfree_skb(skb);
np = &n->next;
write_unlock(&n->lock);
continue;
}
*np = n->next;
DPRINTK("expired neigh %p\n",n);
n->dead = 1;
write_unlock(&n->lock);
neigh_release(n);
}
}
......
......@@ -62,6 +62,13 @@ int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long);
EXPORT_SYMBOL(pppoatm_ioctl_hook);
#endif
#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE)
int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long);
#ifdef CONFIG_ATM_BR2684_MODULE
EXPORT_SYMBOL(br2684_ioctl_hook);
#endif
#endif
#include "resources.h" /* atm_find_dev */
#include "common.h" /* prototypes */
#include "protocols.h" /* atm_init_<transport> */
......@@ -120,7 +127,6 @@ int atm_create(struct socket *sock,int protocol,int family)
vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */
vcc->atm_options = vcc->aal_options = 0;
init_waitqueue_head(&vcc->sleep);
skb_queue_head_init(&vcc->listenq);
sk->sleep = &vcc->sleep;
sock->sk = sk;
return 0;
......@@ -489,7 +495,7 @@ unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait)
vcc = ATM_SD(sock);
poll_wait(file,&vcc->sleep,wait);
mask = 0;
if (skb_peek(&vcc->sk->receive_queue) || skb_peek(&vcc->listenq))
if (skb_peek(&vcc->sk->receive_queue))
mask |= POLLIN | POLLRDNORM;
if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
test_bit(ATM_VF_CLOSE,&vcc->flags))
......@@ -784,6 +790,13 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg)
if (ret_val != -ENOIOCTLCMD)
goto done;
}
#endif
#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE)
if (br2684_ioctl_hook) {
ret_val = br2684_ioctl_hook(vcc, cmd, arg);
if (ret_val != -ENOIOCTLCMD)
goto done;
}
#endif
if (get_user(buf,&((struct atmif_sioc *) arg)->arg)) {
ret_val = -EFAULT;
......
......@@ -302,7 +302,7 @@ lec_send_packet(struct sk_buff *skb, struct net_device *dev)
#endif
min_frame_size = LEC_MINIMUM_8023_SIZE;
if (skb->len < min_frame_size) {
if (skb->truesize < min_frame_size) {
if ((skb->len + skb_tailroom(skb)) < min_frame_size) {
skb2 = skb_copy_expand(skb, 0,
min_frame_size - skb->truesize, GFP_ATOMIC);
dev_kfree_skb(skb);
......
......@@ -129,12 +129,12 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
case as_indicate:
vcc = *(struct atm_vcc **) &msg->listen_vcc;
DPRINTK("as_indicate!!!\n");
if (!vcc->backlog_quota) {
if (vcc->sk->ack_backlog == vcc->sk->max_ack_backlog) {
sigd_enq(0,as_reject,vcc,NULL,NULL);
return 0;
}
vcc->backlog_quota--;
skb_queue_tail(&vcc->listenq,skb);
vcc->sk->ack_backlog++;
skb_queue_tail(&vcc->sk->receive_queue,skb);
if (vcc->callback) {
DPRINTK("waking vcc->sleep 0x%p\n",
&vcc->sleep);
......
......@@ -74,7 +74,7 @@ static void svc_disconnect(struct atm_vcc *vcc)
}
/* beware - socket is still in use by atmsigd until the last
as_indicate has been answered */
while ((skb = skb_dequeue(&vcc->listenq))) {
while ((skb = skb_dequeue(&vcc->sk->receive_queue))) {
DPRINTK("LISTEN REL\n");
sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0);
dev_kfree_skb(skb);
......@@ -253,7 +253,7 @@ static int svc_listen(struct socket *sock,int backlog)
remove_wait_queue(&vcc->sleep,&wait);
if (!sigd) return -EUNATCH;
set_bit(ATM_VF_LISTEN,&vcc->flags);
vcc->backlog_quota = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
vcc->sk->max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
return vcc->reply;
}
......@@ -277,7 +277,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
DECLARE_WAITQUEUE(wait,current);
add_wait_queue(&old_vcc->sleep,&wait);
while (!(skb = skb_dequeue(&old_vcc->listenq)) && sigd) {
while (!(skb = skb_dequeue(&old_vcc->sk->receive_queue)) && sigd) {
if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break;
if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) {
error = old_vcc->reply;
......@@ -306,7 +306,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
error = atm_connect(newsock,msg->pvc.sap_addr.itf,
msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci);
dev_kfree_skb(skb);
old_vcc->backlog_quota++;
old_vcc->sk->ack_backlog--;
if (error) {
sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL,
&old_vcc->qos,error);
......
......@@ -143,6 +143,9 @@ int br_handle_frame(struct sk_buff *skb)
return -1;
}
if (!memcmp(p->br->dev.dev_addr, dest, ETH_ALEN))
skb->pkt_type = PACKET_HOST;
NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
br_handle_frame_finish);
rcu_read_unlock();
......
......@@ -126,9 +126,6 @@ struct sk_buff *alloc_skb(unsigned int size, int gfp_mask)
struct sk_buff *skb;
u8 *data;
if (gfp_mask & __GFP_WAIT)
might_sleep();
/* Get the HEAD */
skb = kmem_cache_alloc(skbuff_head_cache,
gfp_mask & ~__GFP_DMA);
......
......@@ -926,6 +926,7 @@ struct proto_ops inet_dgram_ops = {
struct net_proto_family inet_family_ops = {
.family = PF_INET,
.create = inet_create,
.owner = THIS_MODULE,
};
......
......@@ -115,9 +115,9 @@ struct net_device * ip_dev_find(u32 addr)
if (res.type != RTN_LOCAL)
goto out;
dev = FIB_RES_DEV(res);
if (dev)
atomic_inc(&dev->refcnt);
if (dev)
dev_hold(dev);
out:
fib_res_put(&res);
return dev;
......
......@@ -406,7 +406,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
if (!(dev->flags&IFF_UP))
return -ENETDOWN;
nh->nh_dev = dev;
atomic_inc(&dev->refcnt);
dev_hold(dev);
nh->nh_scope = RT_SCOPE_LINK;
return 0;
}
......@@ -429,7 +429,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
nh->nh_oif = FIB_RES_OIF(res);
if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL)
goto out;
atomic_inc(&nh->nh_dev->refcnt);
dev_hold(nh->nh_dev);
err = -ENETDOWN;
if (!(nh->nh_dev->flags & IFF_UP))
goto out;
......@@ -451,7 +451,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
return -ENETDOWN;
}
nh->nh_dev = in_dev->dev;
atomic_inc(&nh->nh_dev->refcnt);
dev_hold(nh->nh_dev);
nh->nh_scope = RT_SCOPE_HOST;
in_dev_put(in_dev);
}
......
......@@ -444,6 +444,8 @@ static void SMP_TIMER_NAME(tcp_twkill)(unsigned long dummy)
while((tw = tcp_tw_death_row[tcp_tw_death_row_slot]) != NULL) {
tcp_tw_death_row[tcp_tw_death_row_slot] = tw->next_death;
if (tw->next_death)
tw->next_death->pprev_death = tw->pprev_death;
tw->pprev_death = NULL;
spin_unlock(&tw_death_lock);
......
......@@ -535,6 +535,7 @@ struct proto_ops inet6_dgram_ops = {
struct net_proto_family inet6_family_ops = {
.family = PF_INET6,
.create = inet6_create,
.owner = THIS_MODULE,
};
#ifdef MODULE
......
......@@ -593,7 +593,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nlmsghdr *nlh)
#ifdef CONFIG_IPV6_SUBTREES
/* Subtree creation failed, probably main tree node
is orphan. If it is, shot it.
is orphan. If it is, shoot it.
*/
st_failure:
if (fn && !(fn->fn_flags&RTN_RTINFO|RTN_ROOT))
......@@ -953,7 +953,7 @@ int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh)
#if RT6_DEBUG >= 2
if (rt->u.dst.obsolete>0) {
BUG_TRAP(fn==NULL || rt->u.dst.obsolete<=0);
BUG_TRAP(fn==NULL);
return -ENOENT;
}
#endif
......@@ -979,7 +979,7 @@ int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh)
}
/*
* Tree transversal function.
* Tree traversal function.
*
* Certainly, it is not interrupt safe.
* However, it is internally reenterable wrt itself and fib6_add/fib6_del.
......@@ -1179,14 +1179,14 @@ static int fib6_age(struct rt6_info *rt, void *arg)
*/
if (rt->rt6i_flags&RTF_EXPIRES && rt->rt6i_expires) {
if ((long)(now - rt->rt6i_expires) > 0) {
if (time_after(now, rt->rt6i_expires)) {
RT6_TRACE("expiring %p\n", rt);
return -1;
}
gc_args.more++;
} else if (rt->rt6i_flags & RTF_CACHE) {
if (atomic_read(&rt->u.dst.__refcnt) == 0 &&
(long)(now - rt->u.dst.lastuse) >= gc_args.timeout) {
time_after_eq(now, rt->u.dst.lastuse + gc_args.timeout)) {
RT6_TRACE("aging clone %p\n", rt);
return -1;
}
......
......@@ -39,6 +39,7 @@
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#endif
#include <net/snmp.h>
......@@ -564,7 +565,7 @@ static int ip6_dst_gc()
static unsigned long last_gc;
unsigned long now = jiffies;
if ((long)(now - last_gc) < ip6_rt_gc_min_interval &&
if (time_after(last_gc + ip6_rt_gc_min_interval, now) &&
atomic_read(&ip6_dst_ops.entries) <= ip6_rt_max_size)
goto out;
......@@ -1751,27 +1752,28 @@ static int rt6_proc_info(char *buffer, char **start, off_t offset, int length)
extern struct rt6_statistics rt6_stats;
static int rt6_proc_stats(char *buffer, char **start, off_t offset, int length)
static int rt6_stats_seq_show(struct seq_file *seq, void *v)
{
int len;
len = sprintf(buffer, "%04x %04x %04x %04x %04x %04x\n",
seq_printf(seq, "%04x %04x %04x %04x %04x %04x\n",
rt6_stats.fib_nodes, rt6_stats.fib_route_nodes,
rt6_stats.fib_rt_alloc, rt6_stats.fib_rt_entries,
rt6_stats.fib_rt_cache,
atomic_read(&ip6_dst_ops.entries));
len -= offset;
if (len > length)
len = length;
if(len < 0)
len = 0;
*start = buffer + offset;
return 0;
}
return len;
static int rt6_stats_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, rt6_stats_seq_show, NULL);
}
static struct file_operations rt6_stats_seq_fops = {
.open = rt6_stats_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif /* CONFIG_PROC_FS */
#ifdef CONFIG_SYSCTL
......@@ -1877,6 +1879,8 @@ ctl_table ipv6_route_table[] = {
void __init ip6_route_init(void)
{
struct proc_dir_entry *p;
ip6_dst_ops.kmem_cachep = kmem_cache_create("ip6_dst_cache",
sizeof(struct rt6_info),
0, SLAB_HWCACHE_ALIGN,
......@@ -1884,7 +1888,9 @@ void __init ip6_route_init(void)
fib6_init();
#ifdef CONFIG_PROC_FS
proc_net_create("ipv6_route", 0, rt6_proc_info);
proc_net_create("rt6_stats", 0, rt6_proc_stats);
p = create_proc_entry("rt6_stats", S_IRUGO, proc_net);
if (p)
p->proc_fops = &rt6_stats_seq_fops;
#endif
xfrm6_init();
}
......@@ -1894,7 +1900,7 @@ void ip6_route_cleanup(void)
{
#ifdef CONFIG_PROC_FS
proc_net_remove("ipv6_route");
proc_net_remove("rt6_stats");
remove_proc_entry("rt6_stats", proc_net);
#endif
xfrm6_fini();
rt6_ifdown(NULL);
......
......@@ -1280,26 +1280,26 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a
* We don't need try_module_get here, as the listening socket (sock)
* has the protocol module (sock->ops->owner) held.
*/
__module_get(sock->ops->owner);
__module_get(newsock->ops->owner);
err = sock->ops->accept(sock, newsock, sock->file->f_flags);
if (err < 0)
goto out_module_put;
goto out_release;
if (upeer_sockaddr) {
if(newsock->ops->getname(newsock, (struct sockaddr *)address, &len, 2)<0) {
err = -ECONNABORTED;
goto out_module_put;
goto out_release;
}
err = move_addr_to_user(address, len, upeer_sockaddr, upeer_addrlen);
if (err < 0)
goto out_module_put;
goto out_release;
}
/* File flags are not inherited via accept() unlike another OSes. */
if ((err = sock_map_fd(newsock)) < 0)
goto out_module_put;
goto out_release;
security_socket_post_accept(sock, newsock);
......@@ -1307,8 +1307,6 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a
sockfd_put(sock);
out:
return err;
out_module_put:
module_put(sock->ops->owner);
out_release:
sock_release(newsock);
goto out_put;
......
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