From a13ffdabccc99b57bdb73bc04662a95e6f93df8e Mon Sep 17 00:00:00 2001 From: bz Date: Wed, 28 Sep 2011 13:48:36 +0000 Subject: 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 --- sys/net/raw_usrreq.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/net/raw_usrreq.c') 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); -- cgit v1.1