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 ...@@ -3027,8 +3027,8 @@ E: torvalds@transmeta.com
W: http://www.cs.helsinki.fi/Linus.Torvalds 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 P: 1024/A86B35C5 96 54 50 29 EC 11 44 7A BE 67 3C 24 03 13 62 C8
D: Original kernel hacker D: Original kernel hacker
S: 1050 Woodduck Avenue S: 3990 Freedom Circle
S: Santa Clara, California 95051 S: Santa Clara, California 95054
S: USA S: USA
N: Marcelo W. Tosatti N: Marcelo W. Tosatti
......
...@@ -440,5 +440,19 @@ config ATM_FORE200E ...@@ -440,5 +440,19 @@ config ATM_FORE200E
default m if ATM_FORE200E_MAYBE!=y default m if ATM_FORE200E_MAYBE!=y
default y 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 endmenu
...@@ -49,6 +49,10 @@ ifeq ($(CONFIG_ATM_FORE200E_SBA),y) ...@@ -49,6 +49,10 @@ ifeq ($(CONFIG_ATM_FORE200E_SBA),y)
CONFIG_ATM_FORE200E_SBA_FW := $(obj)/sba200e_ecd.bin2 CONFIG_ATM_FORE200E_SBA_FW := $(obj)/sba200e_ecd.bin2
endif endif
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 # FORE Systems 200E-series firmware magic
$(obj)/fore200e_pca_fw.c: $(patsubst "%", %, $(CONFIG_ATM_FORE200E_PCA_FW)) \ $(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 { ...@@ -96,6 +96,8 @@ struct atm_dev_stats {
/* enable or disable single-copy */ /* enable or disable single-copy */
#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t) #define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
/* set backend handler */ /* 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 * These are backend handkers that can be set via the ATM_SETBACKEND call
...@@ -104,7 +106,7 @@ struct atm_dev_stats { ...@@ -104,7 +106,7 @@ struct atm_dev_stats {
*/ */
#define ATM_BACKEND_RAW 0 #define ATM_BACKEND_RAW 0
#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */ #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 */ /* for ATM_GETTYPE */
#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */ #define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
...@@ -304,9 +306,6 @@ struct atm_vcc { ...@@ -304,9 +306,6 @@ struct atm_vcc {
struct sockaddr_atmsvc local; struct sockaddr_atmsvc local;
struct sockaddr_atmsvc remote; struct sockaddr_atmsvc remote;
void (*callback)(struct atm_vcc *vcc); 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 */ int reply; /* also used by ATMTCP */
/* Multipoint part ------------------------------------------------- */ /* Multipoint part ------------------------------------------------- */
struct atm_vcc *session; /* session VCC descriptor */ struct atm_vcc *session; /* session VCC descriptor */
......
...@@ -78,7 +78,7 @@ struct rtattr ...@@ -78,7 +78,7 @@ struct rtattr
/****************************************************************************** /******************************************************************************
* Definitions used in routing table administation. * Definitions used in routing table administration.
****/ ****/
struct rtmsg struct rtmsg
...@@ -129,14 +129,14 @@ enum ...@@ -129,14 +129,14 @@ enum
#define RTPROT_STATIC 4 /* Route installed by administrator */ #define RTPROT_STATIC 4 /* Route installed by administrator */
/* Values of protocol >= RTPROT_STATIC are not interpreted by kernel; /* 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. It will be used by hypothetical multiple routing daemons.
Note that protocol values should be standardized in order to Note that protocol values should be standardized in order to
avoid conflicts. avoid conflicts.
*/ */
#define RTPROT_GATED 8 /* Apparently, GateD */ #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_MRT 10 /* Merit MRT */
#define RTPROT_ZEBRA 11 /* Zebra */ #define RTPROT_ZEBRA 11 /* Zebra */
#define RTPROT_BIRD 12 /* BIRD */ #define RTPROT_BIRD 12 /* BIRD */
...@@ -210,8 +210,8 @@ enum rtattr_type_t ...@@ -210,8 +210,8 @@ enum rtattr_type_t
/* RTM_MULTIPATH --- array of struct rtnexthop. /* RTM_MULTIPATH --- array of struct rtnexthop.
* *
* "struct rtnexthop" describres all necessary nexthop information, * "struct rtnexthop" describes all necessary nexthop information,
* i.e. parameters of path to a destination via this nextop. * i.e. parameters of path to a destination via this nexthop.
* *
* At the moment it is impossible to set different prefsrc, mtu, window * At the moment it is impossible to set different prefsrc, mtu, window
* and rtt for different paths from multipath. * and rtt for different paths from multipath.
...@@ -485,7 +485,7 @@ enum ...@@ -485,7 +485,7 @@ enum
Comments: Comments:
- Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid - 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. the interface is NBMA.
- IFF_MULTICAST does not mean anything special: - IFF_MULTICAST does not mean anything special:
......
...@@ -266,6 +266,23 @@ config ATM_MPOA ...@@ -266,6 +266,23 @@ config ATM_MPOA
subnetwork boundaries. These shortcut connections bypass routers subnetwork boundaries. These shortcut connections bypass routers
enhancing overall network performance. 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 config VLAN_8021Q
tristate "802.1Q VLAN Support" tristate "802.1Q VLAN Support"
......
...@@ -7,6 +7,7 @@ mpoa-objs := mpc.o mpoa_caches.o mpoa_proc.o ...@@ -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) := 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_CLIP) += clip.o ipcommon.o
obj-$(CONFIG_ATM_BR2684) += br2684.o ipcommon.o
obj-$(CONFIG_NET_SCH_ATM) += ipcommon.o obj-$(CONFIG_NET_SCH_ATM) += ipcommon.o
obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_PROC_FS) += proc.o
......
This diff is collapsed.
...@@ -127,6 +127,8 @@ static void idle_timer_check(unsigned long dummy) ...@@ -127,6 +127,8 @@ static void idle_timer_check(unsigned long dummy)
struct atmarp_entry *entry = NEIGH2ENTRY(n); struct atmarp_entry *entry = NEIGH2ENTRY(n);
struct clip_vcc *clip_vcc; struct clip_vcc *clip_vcc;
write_lock(&n->lock);
for (clip_vcc = entry->vccs; clip_vcc; for (clip_vcc = entry->vccs; clip_vcc;
clip_vcc = clip_vcc->next) clip_vcc = clip_vcc->next)
if (clip_vcc->idle_timeout && if (clip_vcc->idle_timeout &&
...@@ -141,6 +143,7 @@ static void idle_timer_check(unsigned long dummy) ...@@ -141,6 +143,7 @@ static void idle_timer_check(unsigned long dummy)
if (entry->vccs || if (entry->vccs ||
time_before(jiffies, entry->expires)) { time_before(jiffies, entry->expires)) {
np = &n->next; np = &n->next;
write_unlock(&n->lock);
continue; continue;
} }
if (atomic_read(&n->refcnt) > 1) { if (atomic_read(&n->refcnt) > 1) {
...@@ -152,11 +155,13 @@ static void idle_timer_check(unsigned long dummy) ...@@ -152,11 +155,13 @@ static void idle_timer_check(unsigned long dummy)
NULL) NULL)
dev_kfree_skb(skb); dev_kfree_skb(skb);
np = &n->next; np = &n->next;
write_unlock(&n->lock);
continue; continue;
} }
*np = n->next; *np = n->next;
DPRINTK("expired neigh %p\n",n); DPRINTK("expired neigh %p\n",n);
n->dead = 1; n->dead = 1;
write_unlock(&n->lock);
neigh_release(n); neigh_release(n);
} }
} }
......
...@@ -62,6 +62,13 @@ int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); ...@@ -62,6 +62,13 @@ int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long);
EXPORT_SYMBOL(pppoatm_ioctl_hook); EXPORT_SYMBOL(pppoatm_ioctl_hook);
#endif #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 "resources.h" /* atm_find_dev */
#include "common.h" /* prototypes */ #include "common.h" /* prototypes */
#include "protocols.h" /* atm_init_<transport> */ #include "protocols.h" /* atm_init_<transport> */
...@@ -120,7 +127,6 @@ int atm_create(struct socket *sock,int protocol,int family) ...@@ -120,7 +127,6 @@ int atm_create(struct socket *sock,int protocol,int family)
vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */
vcc->atm_options = vcc->aal_options = 0; vcc->atm_options = vcc->aal_options = 0;
init_waitqueue_head(&vcc->sleep); init_waitqueue_head(&vcc->sleep);
skb_queue_head_init(&vcc->listenq);
sk->sleep = &vcc->sleep; sk->sleep = &vcc->sleep;
sock->sk = sk; sock->sk = sk;
return 0; return 0;
...@@ -489,7 +495,7 @@ unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait) ...@@ -489,7 +495,7 @@ unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait)
vcc = ATM_SD(sock); vcc = ATM_SD(sock);
poll_wait(file,&vcc->sleep,wait); poll_wait(file,&vcc->sleep,wait);
mask = 0; mask = 0;
if (skb_peek(&vcc->sk->receive_queue) || skb_peek(&vcc->listenq)) if (skb_peek(&vcc->sk->receive_queue))
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
if (test_bit(ATM_VF_RELEASED,&vcc->flags) || if (test_bit(ATM_VF_RELEASED,&vcc->flags) ||
test_bit(ATM_VF_CLOSE,&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) ...@@ -784,6 +790,13 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg)
if (ret_val != -ENOIOCTLCMD) if (ret_val != -ENOIOCTLCMD)
goto done; 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 #endif
if (get_user(buf,&((struct atmif_sioc *) arg)->arg)) { if (get_user(buf,&((struct atmif_sioc *) arg)->arg)) {
ret_val = -EFAULT; ret_val = -EFAULT;
......
...@@ -302,7 +302,7 @@ lec_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -302,7 +302,7 @@ lec_send_packet(struct sk_buff *skb, struct net_device *dev)
#endif #endif
min_frame_size = LEC_MINIMUM_8023_SIZE; min_frame_size = LEC_MINIMUM_8023_SIZE;
if (skb->len < min_frame_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, skb2 = skb_copy_expand(skb, 0,
min_frame_size - skb->truesize, GFP_ATOMIC); min_frame_size - skb->truesize, GFP_ATOMIC);
dev_kfree_skb(skb); dev_kfree_skb(skb);
......
...@@ -129,12 +129,12 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) ...@@ -129,12 +129,12 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
case as_indicate: case as_indicate:
vcc = *(struct atm_vcc **) &msg->listen_vcc; vcc = *(struct atm_vcc **) &msg->listen_vcc;
DPRINTK("as_indicate!!!\n"); 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); sigd_enq(0,as_reject,vcc,NULL,NULL);
return 0; return 0;
} }
vcc->backlog_quota--; vcc->sk->ack_backlog++;
skb_queue_tail(&vcc->listenq,skb); skb_queue_tail(&vcc->sk->receive_queue,skb);
if (vcc->callback) { if (vcc->callback) {
DPRINTK("waking vcc->sleep 0x%p\n", DPRINTK("waking vcc->sleep 0x%p\n",
&vcc->sleep); &vcc->sleep);
......
...@@ -74,7 +74,7 @@ static void svc_disconnect(struct atm_vcc *vcc) ...@@ -74,7 +74,7 @@ static void svc_disconnect(struct atm_vcc *vcc)
} }
/* beware - socket is still in use by atmsigd until the last /* beware - socket is still in use by atmsigd until the last
as_indicate has been answered */ as_indicate has been answered */
while ((skb = skb_dequeue(&vcc->listenq))) { while ((skb = skb_dequeue(&vcc->sk->receive_queue))) {
DPRINTK("LISTEN REL\n"); DPRINTK("LISTEN REL\n");
sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0);
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -253,7 +253,7 @@ static int svc_listen(struct socket *sock,int backlog) ...@@ -253,7 +253,7 @@ static int svc_listen(struct socket *sock,int backlog)
remove_wait_queue(&vcc->sleep,&wait); remove_wait_queue(&vcc->sleep,&wait);
if (!sigd) return -EUNATCH; if (!sigd) return -EUNATCH;
set_bit(ATM_VF_LISTEN,&vcc->flags); 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; return vcc->reply;
} }
...@@ -277,7 +277,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags) ...@@ -277,7 +277,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
DECLARE_WAITQUEUE(wait,current); DECLARE_WAITQUEUE(wait,current);
add_wait_queue(&old_vcc->sleep,&wait); 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_RELEASED,&old_vcc->flags)) break;
if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) { if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) {
error = old_vcc->reply; error = old_vcc->reply;
...@@ -306,7 +306,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags) ...@@ -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, error = atm_connect(newsock,msg->pvc.sap_addr.itf,
msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci); msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci);
dev_kfree_skb(skb); dev_kfree_skb(skb);
old_vcc->backlog_quota++; old_vcc->sk->ack_backlog--;
if (error) { if (error) {
sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL, sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL,
&old_vcc->qos,error); &old_vcc->qos,error);
......
...@@ -143,6 +143,9 @@ int br_handle_frame(struct sk_buff *skb) ...@@ -143,6 +143,9 @@ int br_handle_frame(struct sk_buff *skb)
return -1; 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, NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL,
br_handle_frame_finish); br_handle_frame_finish);
rcu_read_unlock(); rcu_read_unlock();
......
...@@ -126,9 +126,6 @@ struct sk_buff *alloc_skb(unsigned int size, int gfp_mask) ...@@ -126,9 +126,6 @@ struct sk_buff *alloc_skb(unsigned int size, int gfp_mask)
struct sk_buff *skb; struct sk_buff *skb;
u8 *data; u8 *data;
if (gfp_mask & __GFP_WAIT)
might_sleep();
/* Get the HEAD */ /* Get the HEAD */
skb = kmem_cache_alloc(skbuff_head_cache, skb = kmem_cache_alloc(skbuff_head_cache,
gfp_mask & ~__GFP_DMA); gfp_mask & ~__GFP_DMA);
......
...@@ -926,6 +926,7 @@ struct proto_ops inet_dgram_ops = { ...@@ -926,6 +926,7 @@ struct proto_ops inet_dgram_ops = {
struct net_proto_family inet_family_ops = { struct net_proto_family inet_family_ops = {
.family = PF_INET, .family = PF_INET,
.create = inet_create, .create = inet_create,
.owner = THIS_MODULE,
}; };
......
...@@ -115,9 +115,9 @@ struct net_device * ip_dev_find(u32 addr) ...@@ -115,9 +115,9 @@ struct net_device * ip_dev_find(u32 addr)
if (res.type != RTN_LOCAL) if (res.type != RTN_LOCAL)
goto out; goto out;
dev = FIB_RES_DEV(res); dev = FIB_RES_DEV(res);
if (dev)
atomic_inc(&dev->refcnt);
if (dev)
dev_hold(dev);
out: out:
fib_res_put(&res); fib_res_put(&res);
return dev; return dev;
......
...@@ -406,7 +406,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n ...@@ -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)) if (!(dev->flags&IFF_UP))
return -ENETDOWN; return -ENETDOWN;
nh->nh_dev = dev; nh->nh_dev = dev;
atomic_inc(&dev->refcnt); dev_hold(dev);
nh->nh_scope = RT_SCOPE_LINK; nh->nh_scope = RT_SCOPE_LINK;
return 0; return 0;
} }
...@@ -429,7 +429,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n ...@@ -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); nh->nh_oif = FIB_RES_OIF(res);
if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL) if ((nh->nh_dev = FIB_RES_DEV(res)) == NULL)
goto out; goto out;
atomic_inc(&nh->nh_dev->refcnt); dev_hold(nh->nh_dev);
err = -ENETDOWN; err = -ENETDOWN;
if (!(nh->nh_dev->flags & IFF_UP)) if (!(nh->nh_dev->flags & IFF_UP))
goto out; goto out;
...@@ -451,7 +451,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n ...@@ -451,7 +451,7 @@ static int fib_check_nh(const struct rtmsg *r, struct fib_info *fi, struct fib_n
return -ENETDOWN; return -ENETDOWN;
} }
nh->nh_dev = in_dev->dev; nh->nh_dev = in_dev->dev;
atomic_inc(&nh->nh_dev->refcnt); dev_hold(nh->nh_dev);
nh->nh_scope = RT_SCOPE_HOST; nh->nh_scope = RT_SCOPE_HOST;
in_dev_put(in_dev); in_dev_put(in_dev);
} }
......
...@@ -444,6 +444,8 @@ static void SMP_TIMER_NAME(tcp_twkill)(unsigned long dummy) ...@@ -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) { while((tw = tcp_tw_death_row[tcp_tw_death_row_slot]) != NULL) {
tcp_tw_death_row[tcp_tw_death_row_slot] = tw->next_death; 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; tw->pprev_death = NULL;
spin_unlock(&tw_death_lock); spin_unlock(&tw_death_lock);
......
...@@ -535,6 +535,7 @@ struct proto_ops inet6_dgram_ops = { ...@@ -535,6 +535,7 @@ struct proto_ops inet6_dgram_ops = {
struct net_proto_family inet6_family_ops = { struct net_proto_family inet6_family_ops = {
.family = PF_INET6, .family = PF_INET6,
.create = inet6_create, .create = inet6_create,
.owner = THIS_MODULE,
}; };
#ifdef MODULE #ifdef MODULE
......
...@@ -593,7 +593,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nlmsghdr *nlh) ...@@ -593,7 +593,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nlmsghdr *nlh)
#ifdef CONFIG_IPV6_SUBTREES #ifdef CONFIG_IPV6_SUBTREES
/* Subtree creation failed, probably main tree node /* Subtree creation failed, probably main tree node
is orphan. If it is, shot it. is orphan. If it is, shoot it.
*/ */
st_failure: st_failure:
if (fn && !(fn->fn_flags&RTN_RTINFO|RTN_ROOT)) if (fn && !(fn->fn_flags&RTN_RTINFO|RTN_ROOT))
...@@ -953,7 +953,7 @@ int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh) ...@@ -953,7 +953,7 @@ int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh)
#if RT6_DEBUG >= 2 #if RT6_DEBUG >= 2
if (rt->u.dst.obsolete>0) { if (rt->u.dst.obsolete>0) {
BUG_TRAP(fn==NULL || rt->u.dst.obsolete<=0); BUG_TRAP(fn==NULL);
return -ENOENT; return -ENOENT;
} }
#endif #endif
...@@ -979,7 +979,7 @@ int fib6_del(struct rt6_info *rt, struct nlmsghdr *nlh) ...@@ -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. * Certainly, it is not interrupt safe.
* However, it is internally reenterable wrt itself and fib6_add/fib6_del. * 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) ...@@ -1179,14 +1179,14 @@ static int fib6_age(struct rt6_info *rt, void *arg)
*/ */
if (rt->rt6i_flags&RTF_EXPIRES && rt->rt6i_expires) { 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); RT6_TRACE("expiring %p\n", rt);
return -1; return -1;
} }
gc_args.more++; gc_args.more++;
} else if (rt->rt6i_flags & RTF_CACHE) { } else if (rt->rt6i_flags & RTF_CACHE) {
if (atomic_read(&rt->u.dst.__refcnt) == 0 && 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); RT6_TRACE("aging clone %p\n", rt);
return -1; return -1;
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#endif #endif
#include <net/snmp.h> #include <net/snmp.h>
...@@ -564,7 +565,7 @@ static int ip6_dst_gc() ...@@ -564,7 +565,7 @@ static int ip6_dst_gc()
static unsigned long last_gc; static unsigned long last_gc;
unsigned long now = jiffies; 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) atomic_read(&ip6_dst_ops.entries) <= ip6_rt_max_size)
goto out; goto out;
...@@ -1751,27 +1752,28 @@ static int rt6_proc_info(char *buffer, char **start, off_t offset, int length) ...@@ -1751,27 +1752,28 @@ static int rt6_proc_info(char *buffer, char **start, off_t offset, int length)
extern struct rt6_statistics rt6_stats; 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; seq_printf(seq, "%04x %04x %04x %04x %04x %04x\n",
len = sprintf(buffer, "%04x %04x %04x %04x %04x %04x\n",
rt6_stats.fib_nodes, rt6_stats.fib_route_nodes, rt6_stats.fib_nodes, rt6_stats.fib_route_nodes,
rt6_stats.fib_rt_alloc, rt6_stats.fib_rt_entries, rt6_stats.fib_rt_alloc, rt6_stats.fib_rt_entries,
rt6_stats.fib_rt_cache, rt6_stats.fib_rt_cache,
atomic_read(&ip6_dst_ops.entries)); atomic_read(&ip6_dst_ops.entries));
len -= offset; return 0;
}
if (len > length)
len = length;
if(len < 0)
len = 0;
*start = buffer + offset;
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 */ #endif /* CONFIG_PROC_FS */
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
...@@ -1877,6 +1879,8 @@ ctl_table ipv6_route_table[] = { ...@@ -1877,6 +1879,8 @@ ctl_table ipv6_route_table[] = {
void __init ip6_route_init(void) void __init ip6_route_init(void)
{ {
struct proc_dir_entry *p;
ip6_dst_ops.kmem_cachep = kmem_cache_create("ip6_dst_cache", ip6_dst_ops.kmem_cachep = kmem_cache_create("ip6_dst_cache",
sizeof(struct rt6_info), sizeof(struct rt6_info),
0, SLAB_HWCACHE_ALIGN, 0, SLAB_HWCACHE_ALIGN,
...@@ -1884,7 +1888,9 @@ void __init ip6_route_init(void) ...@@ -1884,7 +1888,9 @@ void __init ip6_route_init(void)
fib6_init(); fib6_init();
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
proc_net_create("ipv6_route", 0, rt6_proc_info); 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 #endif
xfrm6_init(); xfrm6_init();
} }
...@@ -1894,7 +1900,7 @@ void ip6_route_cleanup(void) ...@@ -1894,7 +1900,7 @@ void ip6_route_cleanup(void)
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
proc_net_remove("ipv6_route"); proc_net_remove("ipv6_route");
proc_net_remove("rt6_stats"); remove_proc_entry("rt6_stats", proc_net);
#endif #endif
xfrm6_fini(); xfrm6_fini();
rt6_ifdown(NULL); rt6_ifdown(NULL);
......
...@@ -1280,26 +1280,26 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a ...@@ -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) * We don't need try_module_get here, as the listening socket (sock)
* has the protocol module (sock->ops->owner) held. * 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); err = sock->ops->accept(sock, newsock, sock->file->f_flags);
if (err < 0) if (err < 0)
goto out_module_put; goto out_release;
if (upeer_sockaddr) { if (upeer_sockaddr) {
if(newsock->ops->getname(newsock, (struct sockaddr *)address, &len, 2)<0) { if(newsock->ops->getname(newsock, (struct sockaddr *)address, &len, 2)<0) {
err = -ECONNABORTED; err = -ECONNABORTED;
goto out_module_put; goto out_release;
} }
err = move_addr_to_user(address, len, upeer_sockaddr, upeer_addrlen); err = move_addr_to_user(address, len, upeer_sockaddr, upeer_addrlen);
if (err < 0) if (err < 0)
goto out_module_put; goto out_release;
} }
/* File flags are not inherited via accept() unlike another OSes. */ /* File flags are not inherited via accept() unlike another OSes. */
if ((err = sock_map_fd(newsock)) < 0) if ((err = sock_map_fd(newsock)) < 0)
goto out_module_put; goto out_release;
security_socket_post_accept(sock, newsock); security_socket_post_accept(sock, newsock);
...@@ -1307,8 +1307,6 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a ...@@ -1307,8 +1307,6 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a
sockfd_put(sock); sockfd_put(sock);
out: out:
return err; return err;
out_module_put:
module_put(sock->ops->owner);
out_release: out_release:
sock_release(newsock); sock_release(newsock);
goto out_put; 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