Thread View: comp.bugs.4bsd
1 messages
1 total messages
Started by Mark Andrews
Wed, 04 Nov 1992 18:53
Patch to sys/netinet/raw_ip.c
Author: 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);
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads