NetBSD Problem Report #1581

From gnats  Fri Oct  6 09:21:38 1995
Received: from uran.informatik.uni-bonn.de (uran.informatik.uni-bonn.de [131.220.8.49]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id JAA10722 for <gnats-bugs@gnats.netbsd.org>; Fri, 6 Oct 1995 09:21:32 -0400
Message-Id: <199510061309.OAA00832@beverly.rhein.de>
Date: Fri, 6 Oct 1995 14:09:23 +0100 (MET)
From: Ignatios Souvatzis <is@beverly.rhein.de>
Reply-To: is@beverly.rhein.de
To: gnats-bugs@gnats.netbsd.org
Subject: Missing and wrong prototypes/function headers for kern/uipc_mbuf.c
X-Send-Pr-Version: 3.95

>Number:         1581
>Category:       kern
>Synopsis:       missing/wrong prototypes/function headers in kern/uipc_mbuf.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 06 09:35:01 +0000 1995
>Closed-Date:    Fri Jul 12 17:04:38 +0000 1996
>Last-Modified:  Fri Jul 12 17:05:56 +0000 1996
>Originator:     Ignatios Souvatzis
>Release:        960930
>Organization:
	Dis-
>Environment:

System: NetBSD beverly 1.0A NetBSD 1.0A (BEVERLY) #209: Fri Oct 6 12:48:01 MET 1995 is@beverly:/usr/src/sys/arch/amiga/compile/BEVERLY amiga


>Description:
	m_cat, m_reclaim and m_copydata have no prototype definition im 
	sys/mbuf.h.
	There are a few functions in uipc_mbuf.c with missing return types in
	the function head, leading to the partially wrong default return type
	int.
>How-To-Repeat:
	compile uipc_mbuf.c with -Wall.
	For the missing m_cat prototype, compile net/if_arcsubr.c with -Wall.
>Fix:
	Apply this patch:

Index: sys/mbuf.h
===================================================================
RCS file: /monster/cvs/src/sys/sys/mbuf.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 mbuf.h
*** mbuf.h	1995/10/03 15:06:03	1.1.1.1
--- mbuf.h	1995/10/06 13:05:35
***************
*** 370,378 ****
--- 370,381 ----
  struct	mbuf *m_retryhdr __P((int, int));
  struct	mbuf *m_split __P((struct mbuf *, int, int));
  void	m_adj __P((struct mbuf *, int));
+ void	m_cat __P((struct mbuf *, struct mbuf *));
  int	m_clalloc __P((int, int));
  void	m_copyback __P((struct mbuf *, int, int, caddr_t));
+ void	m_copydata __P((struct mbuf *, int, int, caddr_t));
  void	m_freem __P((struct mbuf *));
+ void	m_reclaim __P((void));

  #ifdef MBTYPES
  int mbtypes[] = {				/* XXX */
Index: kern/uipc_mbuf.c
===================================================================
RCS file: /monster/cvs/src/sys/kern/uipc_mbuf.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 uipc_mbuf.c
*** uipc_mbuf.c	1995/10/03 15:02:29	1.1.1.1
--- uipc_mbuf.c	1995/10/06 12:57:39
***************
*** 73,78 ****
--- 73,79 ----
   * Must be called at splimp.
   */
  /* ARGSUSED */
+ int
  m_clalloc(ncl, nowait)
  	register int ncl;
  	int nowait;
***************
*** 135,140 ****
--- 136,142 ----
  	return (m);
  }

+ void
  m_reclaim()
  {
  	register struct domain *dp;
***************
*** 203,213 ****
  {
  	register struct mbuf *n;

! 	if (m == NULL)
  		return;
  	do {
  		MFREE(m, n);
! 	} while (m = n);
  }

  /*
--- 205,215 ----
  {
  	register struct mbuf *n;

! 	if ((m == NULL))
  		return;
  	do {
  		MFREE(m, n);
! 	} while ((m = n));
  }

  /*
***************
*** 321,326 ****
--- 323,329 ----
   * Copy data from an mbuf chain starting "off" bytes from the beginning,
   * continuing for "len" bytes, into the indicated buffer.
   */
+ void
  m_copydata(m, off, len, cp)
  	register struct mbuf *m;
  	register int off;
***************
*** 356,361 ****
--- 359,365 ----
   * Both chains must be of the same type (e.g. MT_DATA).
   * Any m_pkthdr is not updated.
   */
+ void
  m_cat(m, n)
  	register struct mbuf *m, *n;
  {
***************
*** 445,451 ****
  			}
  			count -= m->m_len;
  		}
! 		while (m = m->m_next)
  			m->m_len = 0;
  	}
  }
--- 449,455 ----
  			}
  			count -= m->m_len;
  		}
! 		while ((m = m->m_next))
  			m->m_len = 0;
  	}
  }
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: is 
State-Changed-When: Fri Jul 12 13:04:38 EDT 1996 
State-Changed-Why:  
This has been taken care long ago. 
>Unformatted:
 Ignatios Souvatzis

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.