Fix one of two bugs introduced by the descriptor handling changes

(rev 1.125): correct the check for fd_getsock() failure in
gre_socreate().

The second bug is more complicated to fix.  Since rev 1.125,
gre_reconf() is using the file descriptor table of the current
process instead of the process 0's (the kernel's).
This commit is contained in:
dyoung 2008-04-03 07:19:32 +00:00
parent 0228252053
commit b674c86ad6
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gre.c,v 1.127 2008/04/03 07:12:16 dyoung Exp $ */ /* $NetBSD: if_gre.c,v 1.128 2008/04/03 07:19:32 dyoung Exp $ */
/* /*
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@ -47,7 +47,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.127 2008/04/03 07:12:16 dyoung Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.128 2008/04/03 07:19:32 dyoung Exp $");
#include "opt_gre.h" #include "opt_gre.h"
#include "opt_inet.h" #include "opt_inet.h"
@ -474,7 +474,7 @@ gre_socreate(struct gre_softc *sc, struct gre_soparm *sp, int *fdout)
return rc; return rc;
} }
if ((rc = fd_getsock(fd, &so)) == 0) if ((rc = fd_getsock(fd, &so)) != 0)
return rc; return rc;
if ((m = getsombuf(so, MT_SONAME)) == NULL) { if ((m = getsombuf(so, MT_SONAME)) == NULL) {