Signed-off-by: Alexey Dobriyan <[email protected]>
---
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3231,7 +3231,7 @@ static int selinux_socket_sock_rcv_skb(s
goto out;
/* Handle mapped IPv4 packets arriving via IPv6 sockets */
- if (family == PF_INET6 && skb->protocol == ntohs(ETH_P_IP))
+ if (family == PF_INET6 && skb->protocol == htons(ETH_P_IP))
family = PF_INET;
read_lock_bh(&sk->sk_callback_lock);
On Tue, 16 May 2006, Alexey Dobriyan wrote:
> Signed-off-by: Alexey Dobriyan <[email protected]>
Hmm, I'm certain this was tested (perhaps on a BE machine, though). In any
case skb->protocol should definitely be network byte order.
Acked-by: James Morris <[email protected]>
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -3231,7 +3231,7 @@ static int selinux_socket_sock_rcv_skb(s
> goto out;
>
> /* Handle mapped IPv4 packets arriving via IPv6 sockets */
> - if (family == PF_INET6 && skb->protocol == ntohs(ETH_P_IP))
> + if (family == PF_INET6 && skb->protocol == htons(ETH_P_IP))
> family = PF_INET;
>
> read_lock_bh(&sk->sk_callback_lock);
>
--
James Morris
<[email protected]>
James Morris <[email protected]> writes:
> On Tue, 16 May 2006, Alexey Dobriyan wrote:
>
>> Signed-off-by: Alexey Dobriyan <[email protected]>
>
> Hmm, I'm certain this was tested (perhaps on a BE machine, though).
ntohs and htons are identical operations. Either you swap or you don't,
but there is only one way to swap a short.
Andreas.
--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
On Tue, 16 May 2006, Andreas Schwab wrote:
> ntohs and htons are identical operations. Either you swap or you don't,
> but there is only one way to swap a short.
Indeed.
--
James Morris
<[email protected]>
On Tue, May 16, 2006 at 06:24:14PM +0200, Andreas Schwab wrote:
> James Morris <[email protected]> writes:
>
> > On Tue, 16 May 2006, Alexey Dobriyan wrote:
> >
> >> Signed-off-by: Alexey Dobriyan <[email protected]>
> >
> > Hmm, I'm certain this was tested (perhaps on a BE machine, though).
>
> ntohs and htons are identical operations. Either you swap or you don't,
> but there is only one way to swap a short.
Indeed, but that kind of crap still deserves a fix - same result, but
use that kind of misuse is begging for bugs later on.
>>> Signed-off-by: Alexey Dobriyan <[email protected]>
>>
>> Hmm, I'm certain this was tested (perhaps on a BE machine, though).
>
>ntohs and htons are identical operations. Either you swap or you don't,
>but there is only one way to swap a short.
>
...unless PDPs start to get attractive again. :>
Jan Engelhardt
--
Jan Engelhardt <[email protected]> writes:
>>>> Signed-off-by: Alexey Dobriyan <[email protected]>
>>>
>>> Hmm, I'm certain this was tested (perhaps on a BE machine, though).
>>
>>ntohs and htons are identical operations. Either you swap or you don't,
>>but there is only one way to swap a short.
>>
> ...unless PDPs start to get attractive again. :>
No. There are only two ways to order two bytes.
Andreas.
--
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
>>>>> "James" == James Morris <[email protected]> writes:
James> On Tue, 16 May 2006, Alexey Dobriyan wrote:
>> Signed-off-by: Alexey Dobriyan <[email protected]>
James> Hmm, I'm certain this was tested (perhaps on a BE machine,
James> though). In any case skb->protocol should definitely be network
James> byte order.
On all architectures, ntohs is the same as htons -- either the two
bytes are swapped or they're not.
--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
http://www.ertos.nicta.com.au ERTOS within National ICT Australia