aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-27 01:15:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 20:54:16 -0400
commit17fb2c64394a2d5106540d69fc83c183ee7c206e (patch)
treecfc528dd1dde8a711c63b9b05b2e6d2370d5b2ba /net/ipv4/route.c
parente448515c79c3785eae225c25e8cd5b90b470d0a6 (diff)
[IPV4]: RTA_{DST,SRC,GATEWAY,PREFSRC} annotated
these are passed net-endian; use be32 netlink accessors Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c42ed803c3eb..c41ddba02e9d 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2661,11 +2661,11 @@ static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
2661 if (rt->rt_flags & RTCF_NOTIFY) 2661 if (rt->rt_flags & RTCF_NOTIFY)
2662 r->rtm_flags |= RTM_F_NOTIFY; 2662 r->rtm_flags |= RTM_F_NOTIFY;
2663 2663
2664 NLA_PUT_U32(skb, RTA_DST, rt->rt_dst); 2664 NLA_PUT_BE32(skb, RTA_DST, rt->rt_dst);
2665 2665
2666 if (rt->fl.fl4_src) { 2666 if (rt->fl.fl4_src) {
2667 r->rtm_src_len = 32; 2667 r->rtm_src_len = 32;
2668 NLA_PUT_U32(skb, RTA_SRC, rt->fl.fl4_src); 2668 NLA_PUT_BE32(skb, RTA_SRC, rt->fl.fl4_src);
2669 } 2669 }
2670 if (rt->u.dst.dev) 2670 if (rt->u.dst.dev)
2671 NLA_PUT_U32(skb, RTA_OIF, rt->u.dst.dev->ifindex); 2671 NLA_PUT_U32(skb, RTA_OIF, rt->u.dst.dev->ifindex);
@@ -2678,12 +2678,12 @@ static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
2678 NLA_PUT_U32(skb, RTA_MP_ALGO, rt->rt_multipath_alg); 2678 NLA_PUT_U32(skb, RTA_MP_ALGO, rt->rt_multipath_alg);
2679#endif 2679#endif
2680 if (rt->fl.iif) 2680 if (rt->fl.iif)
2681 NLA_PUT_U32(skb, RTA_PREFSRC, rt->rt_spec_dst); 2681 NLA_PUT_BE32(skb, RTA_PREFSRC, rt->rt_spec_dst);
2682 else if (rt->rt_src != rt->fl.fl4_src) 2682 else if (rt->rt_src != rt->fl.fl4_src)
2683 NLA_PUT_U32(skb, RTA_PREFSRC, rt->rt_src); 2683 NLA_PUT_BE32(skb, RTA_PREFSRC, rt->rt_src);
2684 2684
2685 if (rt->rt_dst != rt->rt_gateway) 2685 if (rt->rt_dst != rt->rt_gateway)
2686 NLA_PUT_U32(skb, RTA_GATEWAY, rt->rt_gateway); 2686 NLA_PUT_BE32(skb, RTA_GATEWAY, rt->rt_gateway);
2687 2687
2688 if (rtnetlink_put_metrics(skb, rt->u.dst.metrics) < 0) 2688 if (rtnetlink_put_metrics(skb, rt->u.dst.metrics) < 0)
2689 goto nla_put_failure; 2689 goto nla_put_failure;
@@ -2768,8 +2768,8 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2768 skb->nh.iph->protocol = IPPROTO_ICMP; 2768 skb->nh.iph->protocol = IPPROTO_ICMP;
2769 skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); 2769 skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
2770 2770
2771 src = tb[RTA_SRC] ? nla_get_u32(tb[RTA_SRC]) : 0; 2771 src = tb[RTA_SRC] ? nla_get_be32(tb[RTA_SRC]) : 0;
2772 dst = tb[RTA_DST] ? nla_get_u32(tb[RTA_DST]) : 0; 2772 dst = tb[RTA_DST] ? nla_get_be32(tb[RTA_DST]) : 0;
2773 iif = tb[RTA_IIF] ? nla_get_u32(tb[RTA_IIF]) : 0; 2773 iif = tb[RTA_IIF] ? nla_get_u32(tb[RTA_IIF]) : 0;
2774 2774
2775 if (iif) { 2775 if (iif) {