diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
| commit | 169ed55bd30305b933f52bfab32a58671d44ab68 (patch) | |
| tree | 32e280957474f458901abfce16fa2a1687ef7497 /include/linux/in.h | |
| parent | 3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff) | |
| parent | 45f81b1c96d9793e47ce925d257ea693ce0b193e (diff) | |
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
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); |
