cvs commit: src/sys/emulation/linux linux_socket.c

Andrew Atrens atrens at nortelnetworks.com
Mon Apr 5 07:06:09 PDT 2004


Hi Folks,

I've had a patch in my tree for this for a while now ... fixes a problem
I was seeing with linux clearcase ... Here's a diff of mine vs. this commit
-

Index: linux_socket.c
===================================================================
RCS file: /usr/dfly/repo/src/sys/emulation/linux/linux_socket.c,v
retrieving revision 1.17
retrieving revision 1.15.2.14
diff -u -r1.17 -r1.15.2.14
--- linux_socket.c      5 Apr 2004 00:06:02 -0000       1.17
+++ linux_socket.c      9 Jan 2004 21:25:45 -0000       1.15.2.14
@@ -677,8 +676,13 @@
        sopt.sopt_valsize = sizeof(optval);
        sopt.sopt_td = NULL;
 
-       if (kern_getsockopt(linux_args.s, &sopt) != 0)
-               optval = 0;
+    error = kern_getsockopt(linux_args.s, &sopt);
+
+    if (error == ENOPROTOOPT) /* not a rawip proto socket */
+       error = optval = 0;     /* IP_HDRINCL is not set */
+
+    if (error)
+        return (error);
 
        if (optval == 0) {
                /*



I kind of like mine a bit more - it's a bit more precise in 
handling this specific error, and allows optval to be set and
handled for other cases below.


Andrew.



Matthew Dillon wrote:

> dillon      2004/04/04 17:06:02 PDT
> 
> DragonFly src repository
> 
>   Modified files:
>     sys/emulation/linux  linux_socket.c
>   Log:
>   Quake 3 server (running under linux emulation) was failing with odd '
>   Protocol not available' errors.  The problem turned out to be the
>   internal IP_HDRINCL check that the linux emulation code in the kernel
>   was doing in
>   linux_sendto().  If the internal check fails with an error, the
>   emulation code should simply assume that IP_HDRINCL is off rather then
>   return the error.
>   
>   The bug was introduced during the syscall separation work on this
>   module.
>   FreeBSD-4.x properly ignores the error.  This patch restores behavior
>   for DFly.
>   
>   Reported-by: Sascha Wildner <saw at xxxxxxxxx>
>   
>   Revision  Changes    Path
>   1.17      +2 -3      src/sys/emulation/linux/linux_socket.c
> 
> 
>
http://www.dragonflybsd.org/cvsweb/src/sys/emulation/linux/linux_socket.c.diff?r1=1.16&r2=1.17&f=h






More information about the Commits mailing list