diff options
| author | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-03 10:11:27 -0400 |
|---|---|---|
| committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-03 10:11:27 -0400 |
| commit | 8f987768eb99631374f4ab0bb19cd062baf1397d (patch) | |
| tree | b89aa5c207f7ba6a688f45657424b937f17ceb8a /include/linux/in.h | |
| parent | 63f7526f26f0a9291ac3f7a986aa18ebfb61ec19 (diff) | |
| parent | c8ddb2713c624f432fa5fe3c7ecffcdda46ea0d4 (diff) | |
Merge commit 'v2.6.37-rc1' into for-2.6.37
Diffstat (limited to 'include/linux/in.h')
| -rw-r--r-- | include/linux/in.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/in.h b/include/linux/in.h index 41d88a4689af..beeb6dee2b49 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
| @@ -250,6 +250,25 @@ struct sockaddr_in { | |||
| 250 | 250 | ||
| 251 | #ifdef __KERNEL__ | 251 | #ifdef __KERNEL__ |
| 252 | 252 | ||
| 253 | #include <linux/errno.h> | ||
| 254 | |||
| 255 | static inline int proto_ports_offset(int proto) | ||
| 256 | { | ||
| 257 | switch (proto) { | ||
| 258 | case IPPROTO_TCP: | ||
| 259 | case IPPROTO_UDP: | ||
| 260 | case IPPROTO_DCCP: | ||
| 261 | case IPPROTO_ESP: /* SPI */ | ||
| 262 | case IPPROTO_SCTP: | ||
| 263 | case IPPROTO_UDPLITE: | ||
| 264 | return 0; | ||
| 265 | case IPPROTO_AH: /* SPI */ | ||
| 266 | return 4; | ||
| 267 | default: | ||
| 268 | return -EINVAL; | ||
| 269 | } | ||
| 270 | } | ||
| 271 | |||
| 253 | static inline bool ipv4_is_loopback(__be32 addr) | 272 | static inline bool ipv4_is_loopback(__be32 addr) |
| 254 | { | 273 | { |
| 255 | return (addr & htonl(0xff000000)) == htonl(0x7f000000); | 274 | return (addr & htonl(0xff000000)) == htonl(0x7f000000); |
