stp
[Top] [All Lists]

Re: 64 bit cleanup

To: Michael Werner <michael@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: 64 bit cleanup
From: Aman Singla <aman@xxxxxxxxxxxx>
Date: Mon, 21 Feb 2000 17:27:36 -0800
Cc: stp@xxxxxxxxxxx
Organization: Silicon Graphics, Inc.
References: <200002210538.VAA10007@xxxxxxxxxxxxxxxxxxxx>
Sender: owner-stp@xxxxxxxxxxx
Michael-

My original intent in writing stp/core/stp_inet.c instead of patching
net/ipv4/af_inet.c was to develop more generic code which both TCP/STP
could leverage off without requiring duplication. The current af_inet
is very TCP specific and thus required me to splice in the stp protocol
through the proto_ops vector instead of the proto vector. Thus in
stp_inet_accept I've tried to pull in functionality common to most
INET protocols - tcp and stp in this case.
Accordingly, as the comment at the beginning of stp_inet_accept
says, I'd prefer the sk->prot->accept to just return the error code
instead of the newsk (the newsk will be picked off a list in
(stp)_inet_accept itself; but I didn't want to define my own proto
vector type (because the current declaration of prot->accept is
to return a sock*). Since, currently stp is the only protocol to use
stp_inet.c and its prot->accept is NULL, it shouldn't matter; but
for another protocol to leverage off stp_inet.c it should define
its prot->accept to return an errorcode (or 0) instead of a newsk.

Hope this explanation makes it clearer. Please let me know if you
have any issues with it.

thanks,

:a






Michael Werner wrote:
> 
> filename: stp_inet.c
> linenumber: 290
> 
> original: if ((err = (int)sk->prot->accept(sk, flags, &err)))
>                 release_sock(sk);
>                 return err;
> 
> new:      if ((newsk = sk->prot->accept(sk, flags, &err))==NULL) {
>                         release_sock(sk);
>                         return -EINVAL;
> 
> eror value probably wrong -- need to check it

<Prev in Thread] Current Thread [Next in Thread>