aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-27 00:25:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 20:54:02 -0400
commit9e12bb22e32389b41222c9d9fb55724fed83a038 (patch)
tree8961158286de30363fe3a4c2be25d1d4c89168b2 /net/ipv4
parent046d033148e6936ee2466d38214cf0743a210f39 (diff)
[IPV4]: ip_route_input() annotations
ip_route_input() takes net-endian source and destination address. * Annotated as such. * arguments of its invocations annotated where needed. * local helpers getting the same values passed to by it (ip_route_input_mc(), ip_route_input_slow(), ip_handle_martian_source(), ip_mkroute_input(), ip_mkroute_input_def(), __mkroute_input()) annotated Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/ip_options.c2
-rw-r--r--net/ipv4/route.c22
3 files changed, 14 insertions, 12 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index c8a3723bc001..48e1ccb2ff55 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -710,7 +710,7 @@ static int arp_process(struct sk_buff *skb)
710 unsigned char *arp_ptr; 710 unsigned char *arp_ptr;
711 struct rtable *rt; 711 struct rtable *rt;
712 unsigned char *sha, *tha; 712 unsigned char *sha, *tha;
713 u32 sip, tip; 713 __be32 sip, tip;
714 u16 dev_type = dev->type; 714 u16 dev_type = dev->type;
715 int addr_type; 715 int addr_type;
716 struct neighbour *n; 716 struct neighbour *n;
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index e7437c091326..87f25486fd64 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -607,7 +607,7 @@ int ip_options_rcv_srr(struct sk_buff *skb)
607{ 607{
608 struct ip_options *opt = &(IPCB(skb)->opt); 608 struct ip_options *opt = &(IPCB(skb)->opt);
609 int srrspace, srrptr; 609 int srrspace, srrptr;
610 u32 nexthop; 610 __be32 nexthop;
611 struct iphdr *iph = skb->nh.iph; 611 struct iphdr *iph = skb->nh.iph;
612 unsigned char * optptr = skb->nh.raw + opt->srr; 612 unsigned char * optptr = skb->nh.raw + opt->srr;
613 struct rtable *rt = (struct rtable*)skb->dst; 613 struct rtable *rt = (struct rtable*)skb->dst;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 20ffe8e88c0f..bbe529774fd9 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1596,7 +1596,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
1596 rt->rt_type = res->type; 1596 rt->rt_type = res->type;
1597} 1597}
1598 1598
1599static int ip_route_input_mc(struct sk_buff *skb, u32 daddr, u32 saddr, 1599static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1600 u8 tos, struct net_device *dev, int our) 1600 u8 tos, struct net_device *dev, int our)
1601{ 1601{
1602 unsigned hash; 1602 unsigned hash;
@@ -1681,8 +1681,8 @@ e_inval:
1681static void ip_handle_martian_source(struct net_device *dev, 1681static void ip_handle_martian_source(struct net_device *dev,
1682 struct in_device *in_dev, 1682 struct in_device *in_dev,
1683 struct sk_buff *skb, 1683 struct sk_buff *skb,
1684 u32 daddr, 1684 __be32 daddr,
1685 u32 saddr) 1685 __be32 saddr)
1686{ 1686{
1687 RT_CACHE_STAT_INC(in_martian_src); 1687 RT_CACHE_STAT_INC(in_martian_src);
1688#ifdef CONFIG_IP_ROUTE_VERBOSE 1688#ifdef CONFIG_IP_ROUTE_VERBOSE
@@ -1712,7 +1712,7 @@ static void ip_handle_martian_source(struct net_device *dev,
1712static inline int __mkroute_input(struct sk_buff *skb, 1712static inline int __mkroute_input(struct sk_buff *skb,
1713 struct fib_result* res, 1713 struct fib_result* res,
1714 struct in_device *in_dev, 1714 struct in_device *in_dev,
1715 u32 daddr, u32 saddr, u32 tos, 1715 __be32 daddr, __be32 saddr, u32 tos,
1716 struct rtable **result) 1716 struct rtable **result)
1717{ 1717{
1718 1718
@@ -1813,7 +1813,7 @@ static inline int ip_mkroute_input_def(struct sk_buff *skb,
1813 struct fib_result* res, 1813 struct fib_result* res,
1814 const struct flowi *fl, 1814 const struct flowi *fl,
1815 struct in_device *in_dev, 1815 struct in_device *in_dev,
1816 u32 daddr, u32 saddr, u32 tos) 1816 __be32 daddr, __be32 saddr, u32 tos)
1817{ 1817{
1818 struct rtable* rth = NULL; 1818 struct rtable* rth = NULL;
1819 int err; 1819 int err;
@@ -1838,7 +1838,7 @@ static inline int ip_mkroute_input(struct sk_buff *skb,
1838 struct fib_result* res, 1838 struct fib_result* res,
1839 const struct flowi *fl, 1839 const struct flowi *fl,
1840 struct in_device *in_dev, 1840 struct in_device *in_dev,
1841 u32 daddr, u32 saddr, u32 tos) 1841 __be32 daddr, __be32 saddr, u32 tos)
1842{ 1842{
1843#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED 1843#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
1844 struct rtable* rth = NULL, *rtres; 1844 struct rtable* rth = NULL, *rtres;
@@ -1901,7 +1901,7 @@ static inline int ip_mkroute_input(struct sk_buff *skb,
1901 * 2. IP spoofing attempts are filtered with 100% of guarantee. 1901 * 2. IP spoofing attempts are filtered with 100% of guarantee.
1902 */ 1902 */
1903 1903
1904static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr, 1904static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1905 u8 tos, struct net_device *dev) 1905 u8 tos, struct net_device *dev)
1906{ 1906{
1907 struct fib_result res; 1907 struct fib_result res;
@@ -1920,7 +1920,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
1920 u32 itag = 0; 1920 u32 itag = 0;
1921 struct rtable * rth; 1921 struct rtable * rth;
1922 unsigned hash; 1922 unsigned hash;
1923 u32 spec_dst; 1923 __be32 spec_dst;
1924 int err = -EINVAL; 1924 int err = -EINVAL;
1925 int free_res = 0; 1925 int free_res = 0;
1926 1926
@@ -2087,7 +2087,7 @@ martian_source:
2087 goto e_inval; 2087 goto e_inval;
2088} 2088}
2089 2089
2090int ip_route_input(struct sk_buff *skb, u32 daddr, u32 saddr, 2090int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
2091 u8 tos, struct net_device *dev) 2091 u8 tos, struct net_device *dev)
2092{ 2092{
2093 struct rtable * rth; 2093 struct rtable * rth;
@@ -2740,7 +2740,9 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2740 struct rtmsg *rtm; 2740 struct rtmsg *rtm;
2741 struct nlattr *tb[RTA_MAX+1]; 2741 struct nlattr *tb[RTA_MAX+1];
2742 struct rtable *rt = NULL; 2742 struct rtable *rt = NULL;
2743 u32 dst, src, iif; 2743 __be32 dst = 0;
2744 __be32 src = 0;
2745 u32 iif;
2744 int err; 2746 int err;
2745 struct sk_buff *skb; 2747 struct sk_buff *skb;
2746 2748