Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213884
b: refs/heads/master
c: e760702
h: refs/heads/master
v: v3
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 20, 2010
1 parent dce27a5 commit 8b0e6fb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbe5775bbc00116ed5699babfe17c54f32eb34c3
refs/heads/master: e760702ed8333588f9f21e7bf6597873993006f1
19 changes: 19 additions & 0 deletions trunk/include/linux/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,25 @@ struct sockaddr_in {

#ifdef __KERNEL__

#include <linux/errno.h>

static inline int proto_ports_offset(int proto)
{
switch (proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
case IPPROTO_DCCP:
case IPPROTO_ESP: /* SPI */
case IPPROTO_SCTP:
case IPPROTO_UDPLITE:
return 0;
case IPPROTO_AH: /* SPI */
return 4;
default:
return -EINVAL;
}
}

static inline bool ipv4_is_loopback(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x7f000000);
Expand Down

0 comments on commit 8b0e6fb

Please sign in to comment.