Article View: comp.bugs.4bsd
Article #1Patch to sys/netinet/raw_ip.c
From: Mark Andrews
Date: Wed, 04 Nov 1992 18:53
Date: Wed, 04 Nov 1992 18:53
61 lines
2224 bytes
2224 bytes
This problem appears in both the 4.3reno and Net/2 releases.
There seems to be a parameter mismatch with the function rip_usrreq()
in sys/netinet/raw_ip.c. All protocol dependent usrreq routines are
called with 5 parameters. For example, from sys/net/if.c:
return ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL, cmd, data, ifp));
but rip_usrreq() expects 6 parameters:
rip_usrreq(so, req, m, nam, rights, control)
As pointed out by Julian Elischer (julian@tfs.com) in message
<1992Nov3.071934.25466@tfs.com> in comp.unix.bsd, the rights parameter seems
to be extraneous. Julian's patch fixed this problem but missed the line
where raw_usrreq() is called with one too many parameters (the extra paramter
is `rights') from within rip_usrreq(). Here is the patch that fixes both
problems and matches the parameters correctly:
*** /tmp/,RCSt1a23496 Wed Nov 4 12:25:45 1992
--- raw_ip.c Wed Nov 4 12:21:45 1992
***************
*** 189,198 ****
}
/*ARGSUSED*/
! rip_usrreq(so, req, m, nam, rights, control)
register struct socket *so;
int req;
! struct mbuf *m, *nam, *rights, *control;
{
register int error = 0;
register struct raw_inpcb *rp = sotorawinpcb(so);
--- 189,198 ----
}
/*ARGSUSED*/
! rip_usrreq(so, req, m, nam, control)
register struct socket *so;
int req;
! struct mbuf *m, *nam, *control;
{
register int error = 0;
register struct raw_inpcb *rp = sotorawinpcb(so);
***************
*** 253,259 ****
return (0);
}
}
! error = raw_usrreq(so, req, m, nam, rights, control);
if (error && (req == PRU_ATTACH) && so->so_pcb)
free(so->so_pcb, M_PCB);
--- 253,259 ----
return (0);
}
}
! error = raw_usrreq(so, req, m, nam, control);
if (error && (req == PRU_ATTACH) && so->so_pcb)
free(so->so_pcb, M_PCB);
Technical Details
Message-ID:
<1992Nov4.185315.18061@alias.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!utcsri!geac!alias!newsShow Full Headers
Complete Article Headers
Newsgroups: comp.bugs.4bsd Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!geac!alias!news From: mark@alias.com (Mark Andrews) Subject: Patch to sys/netinet/raw_ip.c Message-ID: <1992Nov4.185315.18061@alias.com> Sender: news@alias.com (News Owner) Organization: Alias Research Inc., Toronto ON Canada Distribution: na Date: Wed, 4 Nov 1992 18:53:15 GMT Lines: 62