From: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC 1/2] Bluetooth: make use of MSG_DONTROUTE flag in L2CAP sockets
Date: Wed, 11 Jan 2012 11:27:07 +0100 [thread overview]
Message-ID: <1326277627.6454.220.camel@aeonflux> (raw)
In-Reply-To: <CABBYNZJ1YuVFjNX+tTu9qsFSnu=2wiBpALe2BTNQqu1152+n0w@mail.gmail.com>
Hi Luiz,
> >> This use MSG_DONTROUTE to send a single message with highest possible
> >> priority without having to rely on socket options.
> >>
> >> This is useful for RFCOMM which relies on socket interface to send frames
> >> to L2CAP, but since some of this frames are actual commands that can
> >> timeout they should be sent as soon as possible.
> >>
> >> For userspace this also offer the convenience of not having to use
> >> setsockopt several times when only a single/some messages needs to be
> >> prioritize.
> >
> > are you sure that we are not mis-using the MSG_DONTROUTE flag?
>
> This is the reason Ive sent as RFC, man page says it is only define
> for protocols that route, but note that MSG_TRYHARD does map to the
> same value (4) so the meaning depend on the protocol. Perhaps creating
> a new flag e.g. MSG_HIGHPRIO would be acceptable?
try to get this upstream via netdev mailing list first. And lets see
where this goes. I personally like the idea, but shoehorning it into
MSG_DONTROUTE seems not really a good idea.
> >> + priority = sk->sk_priority;
> >> +
> >> + /* MSG_DONTROUTE send message at maximum possible priority */
> >> + if ((msg->msg_flags & MSG_DONTROUTE) && priority < HCI_PRIO_MAX - 1)
> >> + priority = HCI_PRIO_MAX - 1;
> >> +
> >
> > you need to enforce the same privilege check that SO_PRIORITY does.
> > Otherwise every single application can just go and overwrite it.
>
> Currently HCI_PRIO_MAX - 1 maps to the highest priority without
> requiring privileges, but I can change that to HCI_PRIO_MAX so only
> privileged processes such bluetoothd can make use of it.
If we wanna do then, we should give privileged daemons to use highest
priority as well.
Regards
Marcel
prev parent reply other threads:[~2012-01-11 10:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-10 13:26 [RFC 1/2] Bluetooth: make use of MSG_DONTROUTE flag in L2CAP sockets Luiz Augusto von Dentz
2012-01-10 13:26 ` [RFC 2/2] Bluetooth: Fix possible timeouts while sending RFCOMM commands Luiz Augusto von Dentz
2012-01-10 16:50 ` [RFC 1/2] Bluetooth: make use of MSG_DONTROUTE flag in L2CAP sockets Marcel Holtmann
2012-01-11 10:07 ` Luiz Augusto von Dentz
2012-01-11 10:27 ` Marcel Holtmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326277627.6454.220.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).