summaryrefslogtreecommitdiffstats
path: root/sys/net/raw_usrreq.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2002-11-20 19:00:54 +0000
committerluigi <luigi@FreeBSD.org>2002-11-20 19:00:54 +0000
commitabbf6b609086058fb129298ed714994d1236fdee (patch)
treefd5c55116b906a53d60ecb5a4a0425a5291252f7 /sys/net/raw_usrreq.c
parentf840da61b0f36260b235839a60e359112342f688 (diff)
downloadFreeBSD-src-abbf6b609086058fb129298ed714994d1236fdee.zip
FreeBSD-src-abbf6b609086058fb129298ed714994d1236fdee.tar.gz
Back out some style changes. They are not urgent,
I will put them back in after 5.0 is out. Requested by: sam Approved by: re
Diffstat (limited to 'sys/net/raw_usrreq.c')
-rw-r--r--sys/net/raw_usrreq.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c
index 39a8819..7afab70 100644
--- a/sys/net/raw_usrreq.c
+++ b/sys/net/raw_usrreq.c
@@ -50,7 +50,7 @@
* Initialize raw connection block q.
*/
void
-raw_init(void)
+raw_init()
{
LIST_INIT(&rawcb_list);
}
@@ -65,15 +65,17 @@ raw_init(void)
* Raw protocol interface.
*/
void
-raw_input(struct mbuf *m0, struct sockproto *proto,
- struct sockaddr *src, struct sockaddr *dst)
+raw_input(m0, proto, src, dst)
+ struct mbuf *m0;
+ register struct sockproto *proto;
+ struct sockaddr *src, *dst;
{
- struct rawcb *rp;
- struct mbuf *m = m0;
- int sockets = 0;
+ register struct rawcb *rp;
+ register struct mbuf *m = m0;
+ register int sockets = 0;
struct socket *last;
- last = NULL;
+ last = 0;
LIST_FOREACH(rp, &rawcb_list, list) {
if (rp->rcb_proto.sp_family != proto->sp_family)
continue;
@@ -88,18 +90,18 @@ raw_input(struct mbuf *m0, struct sockproto *proto,
* Note that if the lengths are not the same
* the comparison will fail at the first byte.
*/
-#define equal(a1, a2) (bcmp((caddr_t)(a1), (caddr_t)(a2), a1->sa_len) == 0)
-
+#define equal(a1, a2) \
+ (bcmp((caddr_t)(a1), (caddr_t)(a2), a1->sa_len) == 0)
if (rp->rcb_laddr && !equal(rp->rcb_laddr, dst))
continue;
if (rp->rcb_faddr && !equal(rp->rcb_faddr, src))
continue;
if (last) {
- struct mbuf *n = m_copypacket(m, M_DONTWAIT);
-
+ struct mbuf *n;
+ n = m_copy(m, 0, (int)M_COPYALL);
if (n) {
if (sbappendaddr(&last->so_rcv, src,
- n, NULL) == 0)
+ n, (struct mbuf *)0) == 0)
/* should notify about lost packet */
m_freem(n);
else {
@@ -111,7 +113,8 @@ raw_input(struct mbuf *m0, struct sockproto *proto,
last = rp->rcb_socket;
}
if (last) {
- if (sbappendaddr(&last->so_rcv, src, m, NULL) == 0)
+ if (sbappendaddr(&last->so_rcv, src,
+ m, (struct mbuf *)0) == 0)
m_freem(m);
else {
sorwakeup(last);
@@ -123,7 +126,10 @@ raw_input(struct mbuf *m0, struct sockproto *proto,
/*ARGSUSED*/
void
-raw_ctlinput(int cmd, struct sockaddr *arg, void *dummy)
+raw_ctlinput(cmd, arg, dummy)
+ int cmd;
+ struct sockaddr *arg;
+ void *dummy;
{
if (cmd < 0 || cmd > PRC_NCMDS)
@@ -193,8 +199,9 @@ raw_udisconnect(struct socket *so)
if (rp == 0)
return EINVAL;
- if (rp->rcb_faddr == 0)
+ if (rp->rcb_faddr == 0) {
return ENOTCONN;
+ }
raw_disconnect(rp);
soisdisconnected(so);
return 0;
@@ -209,8 +216,9 @@ raw_upeeraddr(struct socket *so, struct sockaddr **nam)
if (rp == 0)
return EINVAL;
- if (rp->rcb_faddr == 0)
+ if (rp->rcb_faddr == 0) {
return ENOTCONN;
+ }
*nam = dup_sockaddr(rp->rcb_faddr, 1);
return 0;
}
OpenPOWER on IntegriCloud