diff options
author | bz <bz@FreeBSD.org> | 2011-09-28 13:48:36 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2011-09-28 13:48:36 +0000 |
commit | a13ffdabccc99b57bdb73bc04662a95e6f93df8e (patch) | |
tree | 19deb44c2ae23c609f87f88a0cf3c966f9b800aa /sys/net/raw_usrreq.c | |
parent | ae2bc06327902b65a0e544a5e109882b272b701d (diff) | |
download | FreeBSD-src-a13ffdabccc99b57bdb73bc04662a95e6f93df8e.zip FreeBSD-src-a13ffdabccc99b57bdb73bc04662a95e6f93df8e.tar.gz |
Pass the fibnum where we need filtering of the message on the
rtsock allowing routing daemons to filter routing updates on an
rtsock per FIB.
Adjust raw_input() and split it into wrapper and a new function
taking an optional callback argument even though we only have one
consumer [1] to keep the hackish flags local to rtsock.c.
PR: kern/134931
Submitted by: multiple (see PR)
Suggested by: rwatson [1]
Reviewed by: rwatson
MFC after: 3 days
Diffstat (limited to 'sys/net/raw_usrreq.c')
-rw-r--r-- | sys/net/raw_usrreq.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index 2de3d69..df77063 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -71,6 +71,14 @@ raw_init(void) void raw_input(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src) { + + return (raw_input_ext(m0, proto, src, NULL)); +} + +void +raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src, + raw_input_cb_fn cb) +{ struct rawcb *rp; struct mbuf *m = m0; struct socket *last; @@ -83,6 +91,8 @@ raw_input(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src) if (rp->rcb_proto.sp_protocol && rp->rcb_proto.sp_protocol != proto->sp_protocol) continue; + if (cb != NULL && (*cb)(m, proto, src, rp) != 0) + continue; if (last) { struct mbuf *n; n = m_copy(m, 0, (int)M_COPYALL); |