I just saw this in a patch: + if (ntohs(ih->frag_off) & IP_OFFSET) + return EBT_NOMATCH; This isn't optimal, it requires a byte switch little endian machines. The compiler isn't smart enough. It would be better to use if (ih->frag_off & ntohs(IP_OFFSET)) where the byte-swap can be done at compile time. This is kind of ugly, I guess, so maybe a dedicate macro net_host_bit_p(ih->frag_off, IP_OFFSET) ?? -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
Attachment:
signature.asc
Description: OpenPGP digital signature
- Follow-Ups:
- Re: ntohs/ntohl and bitops
- From: "David S. Miller" <[email protected]>
- Re: ntohs/ntohl and bitops
- Prev by Date: [PATCH] kaudit_thread return val
- Next by Date: Re: [PATCH 1 of 3] Introduce __raw_memcpy_toio32
- Previous by thread: [PATCH] kaudit_thread return val
- Next by thread: Re: ntohs/ntohl and bitops
- Index(es):