public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] sockfd_lookup missing from older kernel patches
@ 2005-01-10 20:04 Colin Pinkney
  2005-01-10 23:54 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Pinkney @ 2005-01-10 20:04 UTC (permalink / raw)
  To: bluez-devel

Hi,

I was updating a BlueZ package for the Sharp Zaurus PDAs that use the 2.4.18 
kernel. The previous package had been using BlueZ libs and utils v2.3 and 
patch 2.4.18-mh8 and had been working ok.

With the latest userspace source and patch 2.4.18-mh15 I noticed the function 
sockfd_lookup had been removed from the sock.c files. This caused a 
unresolved symbol error upon loading the bnep module on the Zaurus.

I noticed in the comments on http://www.holtmann.org/linux/kernel/ that 
sockfd_lookup was removed on Dec 15, 2003 from kernel patches for kernels 
2.4.22 and later. I presume this function has been moved into more central 
kernel code? Was this function supposed to be removed from the patches for 
kernels 2.4.21 and earlier (or at least kernel 2.4.18)?

When I stuck the code below back into bnep/sock.c the module loaded properly 
(although I need to test functionality a bit more as I got the code from the 
patch 2.4.18-mh8).

<<<<<
static inline struct socket *socki_lookup(struct inode *inode)
{
       return &inode->u.socket_i;
}

static struct socket *sockfd_lookup(int fd, int *err)
{
       struct file *file;
       struct inode *inode;
       struct socket *sock;

       if (!(file = fget(fd))) {
               *err = -EBADF;
               return NULL;
       }

       inode = file->f_dentry->d_inode;
       if (!inode->i_sock || !(sock = socki_lookup(inode))) {
               *err = -ENOTSOCK;
               fput(file);
               return NULL;
       }

       if (sock->file != file) {
               printk(KERN_ERR "socki_lookup: socket file changed!\n");
               sock->file = file;
       }
       return sock;
}
>>>>>

Regards,

-- 
Colin Pinkney
http://www.cpinkney.org.uk


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] sockfd_lookup missing from older kernel patches
  2005-01-10 20:04 [Bluez-devel] sockfd_lookup missing from older kernel patches Colin Pinkney
@ 2005-01-10 23:54 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2005-01-10 23:54 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Colin,

> I was updating a BlueZ package for the Sharp Zaurus PDAs that use the 2.4.18 
> kernel. The previous package had been using BlueZ libs and utils v2.3 and 
> patch 2.4.18-mh8 and had been working ok.
> 
> With the latest userspace source and patch 2.4.18-mh15 I noticed the function 
> sockfd_lookup had been removed from the sock.c files. This caused a 
> unresolved symbol error upon loading the bnep module on the Zaurus.
> 
> I noticed in the comments on http://www.holtmann.org/linux/kernel/ that 
> sockfd_lookup was removed on Dec 15, 2003 from kernel patches for kernels 
> 2.4.22 and later. I presume this function has been moved into more central 
> kernel code? Was this function supposed to be removed from the patches for 
> kernels 2.4.21 and earlier (or at least kernel 2.4.18)?

all -mh patches for 2.4 should deal correctly with an exported or non
exported sockfd_lookup(). I tested that a long time ago. However if you
got problems with then simply export that function from the socket core.

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-10 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-10 20:04 [Bluez-devel] sockfd_lookup missing from older kernel patches Colin Pinkney
2005-01-10 23:54 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox