Re: [PATCH] selinux: endian fix

From: James Morris
Date: Tue May 16 2006 - 11:53:31 EST


On Tue, 16 May 2006, Alexey Dobriyan wrote:

> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>

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 <jmorris@xxxxxxxxx>



> --- 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
<jmorris@xxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/