summaryrefslogtreecommitdiff
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorSridhar Samudrala <sri@us.ibm.com>2003-02-17 18:09:28 -0800
committerSridhar Samudrala <sri@us.ibm.com>2003-02-17 18:09:28 -0800
commit9967b51fc01aae6d822ad62ff031ff2d656d5b10 (patch)
treee956f79d598e25a7a42faab23d0794ec992c20fa /net/sctp/protocol.c
parent611f4c044cbd8595d40d09a34981e57aa8aa5f30 (diff)
parent13970d8e1ff3451967050309ce14ae2b6160bfd5 (diff)
Merge us.ibm.com:/home/sridhar/BK/linux-2.5.62
into us.ibm.com:/home/sridhar/BK/lksctp-2.5.62
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index cd8e3b1adb34..85a5a2941af5 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -75,6 +75,9 @@ static struct sctp_af *sctp_af_v6_specific;
extern struct net_proto_family inet_family_ops;
+extern int sctp_snmp_proc_init(void);
+extern int sctp_snmp_proc_exit(void);
+
/* Return the address of the control sock. */
struct sock *sctp_get_ctl_sock(void)
{
@@ -82,21 +85,32 @@ struct sock *sctp_get_ctl_sock(void)
}
/* Set up the proc fs entry for the SCTP protocol. */
-__init void sctp_proc_init(void)
+__init int sctp_proc_init(void)
{
+ int rc = 0;
+
if (!proc_net_sctp) {
struct proc_dir_entry *ent;
ent = proc_mkdir("net/sctp", 0);
if (ent) {
ent->owner = THIS_MODULE;
proc_net_sctp = ent;
- }
+ } else
+ rc = -ENOMEM;
}
+
+ if (sctp_snmp_proc_init())
+ rc = -ENOMEM;
+
+ return rc;
}
/* Clean up the proc fs entry for the SCTP protocol. */
void sctp_proc_exit(void)
{
+
+ sctp_snmp_proc_exit();
+
if (proc_net_sctp) {
proc_net_sctp = NULL;
remove_proc_entry("net/sctp", 0);
@@ -124,7 +138,6 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist,
/* Add the address to the local list. */
addr = t_new(struct sockaddr_storage_list, GFP_ATOMIC);
if (addr) {
- INIT_LIST_HEAD(&addr->list);
addr->a.v4.sin_family = AF_INET;
addr->a.v4.sin_port = 0;
addr->a.v4.sin_addr.s_addr = ifa->ifa_local;
@@ -436,7 +449,6 @@ struct dst_entry *sctp_v4_get_dst(sctp_association_t *asoc,
if (AF_INET == laddr->a.sa.sa_family) {
fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
- dst = sctp_v4_get_dst(asoc, daddr, &laddr->a);
if (!ip_route_output_key(&rt, &fl)) {
dst = &rt->u.dst;
goto out_unlock;
@@ -557,7 +569,7 @@ static void sctp_inet_msgname(char *msgname, int *addr_len)
}
/* Copy the primary address of the peer primary address as the msg_name. */
-static void sctp_inet_event_msgname(sctp_ulpevent_t *event, char *msgname,
+static void sctp_inet_event_msgname(struct sctp_ulpevent *event, char *msgname,
int *addr_len)
{
struct sockaddr_in *sin, *sinfrom;
@@ -628,6 +640,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
NIPQUAD(((struct rtable *)skb->dst)->rt_src),
NIPQUAD(((struct rtable *)skb->dst)->rt_dst));
+ SCTP_INC_STATS(SctpOutSCTPPacks);
return ip_queue_xmit(skb, ipfragok);
}