Date: Fri, 13 Dec 2002 20:21:48 -0800 (PST) From: Kelly Yancey <kbyanc@posi.net> To: net@FreeBSD.org Subject: Re: Raw sockets and splnet() Message-ID: <20021213201926.A33726-200000@gateway.posi.net> In-Reply-To: <20021213194809.N33726-100000@gateway.posi.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-553016530-1039839708=:33726 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 13 Dec 2002, Kelly Yancey wrote: > Actually, as a follow-up to my own question, I don't see how the > splnet()/splx() calls in rtsock.c are necessary at all as all of the pru_* > hooks are called at splnet(). Being that rtsock's pru_* hooks are called at > splnet(), is there any reason not to just extern the various raw_* pru hooks > and reference them directly from route_usrreqs? > > Kelly For a better idea of what I am talking about, a diff against 4.7 is attached. I've confirmed that it compiles and will leave a machine running with this patch up over the weekend. Any comments would be appreciated, Kelly -- Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org} FreeBSD, The Power To Serve: http://www.freebsd.org/ --0-553016530-1039839708=:33726 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rtsock.diff" Content-Transfer-Encoding: BASE64 Content-ID: <20021213202148.A33726@gateway.posi.net> Content-Description: Content-Disposition: attachment; filename="rtsock.diff" SW5kZXg6IHJhd19jYi5oDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1Mg ZmlsZTogL2hvbWUvY3ZzL2Fjcy9iYXNlL3NyYy9zeXMvbmV0L3Jhd19jYi5o LHYNCnJldHJpZXZpbmcgcmV2aXNpb24gMS4xLjEuMQ0KZGlmZiAtdSAtcCAt cjEuMS4xLjEgcmF3X2NiLmgNCi0tLSByYXdfY2IuaAkyMiBNYXIgMjAwMiAw NDoxMTowMCAtMDAwMAkxLjEuMS4xDQorKysgcmF3X2NiLmgJMTQgR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gcHJfdXNycmVxcyByb3V0ZV91 c3JyZXFzID0gew0KLQlydHNfYWJvcnQsIHBydV9hY2NlcHRfbm90c3VwcCwg cnRzX2F0dGFjaCwgcnRzX2JpbmQsIHJ0c19jb25uZWN0LA0KLQlwcnVfY29u bmVjdDJfbm90c3VwcCwgcHJ1X2NvbnRyb2xfbm90c3VwcCwgcnRzX2RldGFj aCwgcnRzX2Rpc2Nvbm5lY3QsDQotCXBydV9saXN0ZW5fbm90c3VwcCwgcnRz X3BlZXJhZGRyLCBwcnVfcmN2ZF9ub3RzdXBwLCBwcnVfcmN2b29iX25vdHN1 cHAsDQotCXJ0c19zZW5kLCBwcnVfc2Vuc2VfbnVsbCwgcnRzX3NodXRkb3du LCBydHNfc29ja2FkZHIsDQorCXJhd191YWJvcnQsIHBydV9hY2NlcHRfbm90 c3VwcCwgcnRzX2F0dGFjaCwgcmF3X3ViaW5kLCByYXdfdWNvbm5lY3QsDQor CXBydV9jb25uZWN0Ml9ub3RzdXBwLCBwcnVfY29udHJvbF9ub3RzdXBwLCBy dHNfZGV0YWNoLCByYXdfdWRpc2Nvbm5lY3QsDQorCXBydV9saXN0ZW5fbm90 c3VwcCwgcmF3X3VwZWVyYWRkciwgcHJ1X3JjdmRfbm90c3VwcCwgcHJ1X3Jj dm9vYl9ub3RzdXBwLA0KKwlyYXdfdXNlbmQsIHBydV9zZW5zZV9udWxsLCBy YXdfdXNodXRkb3duLCByYXdfdXNvY2thZGRyLA0KIAlzb3NlbmQsIHNvcmVj ZWl2ZSwgc29wb2xsDQogfTsNCiANCg== --0-553016530-1039839708=:33726-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021213201926.A33726-200000>