aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.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/fib_semantics.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/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 152d9a264fab..d91244782216 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -374,7 +374,7 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
374 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); 374 struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
375 375
376 nla = nla_find(attrs, attrlen, RTA_GATEWAY); 376 nla = nla_find(attrs, attrlen, RTA_GATEWAY);
377 nh->nh_gw = nla ? nla_get_u32(nla) : 0; 377 nh->nh_gw = nla ? nla_get_be32(nla) : 0;
378#ifdef CONFIG_NET_CLS_ROUTE 378#ifdef CONFIG_NET_CLS_ROUTE
379 nla = nla_find(attrs, attrlen, RTA_FLOW); 379 nla = nla_find(attrs, attrlen, RTA_FLOW);
380 nh->nh_tclassid = nla ? nla_get_u32(nla) : 0; 380 nh->nh_tclassid = nla ? nla_get_u32(nla) : 0;
@@ -427,7 +427,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
427 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); 427 struct nlattr *nla, *attrs = rtnh_attrs(rtnh);
428 428
429 nla = nla_find(attrs, attrlen, RTA_GATEWAY); 429 nla = nla_find(attrs, attrlen, RTA_GATEWAY);
430 if (nla && nla_get_u32(nla) != nh->nh_gw) 430 if (nla && nla_get_be32(nla) != nh->nh_gw)
431 return 1; 431 return 1;
432#ifdef CONFIG_NET_CLS_ROUTE 432#ifdef CONFIG_NET_CLS_ROUTE
433 nla = nla_find(attrs, attrlen, RTA_FLOW); 433 nla = nla_find(attrs, attrlen, RTA_FLOW);
@@ -952,7 +952,7 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
952 rtm->rtm_protocol = fi->fib_protocol; 952 rtm->rtm_protocol = fi->fib_protocol;
953 953
954 if (rtm->rtm_dst_len) 954 if (rtm->rtm_dst_len)
955 NLA_PUT_U32(skb, RTA_DST, dst); 955 NLA_PUT_BE32(skb, RTA_DST, dst);
956 956
957 if (fi->fib_priority) 957 if (fi->fib_priority)
958 NLA_PUT_U32(skb, RTA_PRIORITY, fi->fib_priority); 958 NLA_PUT_U32(skb, RTA_PRIORITY, fi->fib_priority);
@@ -961,11 +961,11 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
961 goto nla_put_failure; 961 goto nla_put_failure;
962 962
963 if (fi->fib_prefsrc) 963 if (fi->fib_prefsrc)
964 NLA_PUT_U32(skb, RTA_PREFSRC, fi->fib_prefsrc); 964 NLA_PUT_BE32(skb, RTA_PREFSRC, fi->fib_prefsrc);
965 965
966 if (fi->fib_nhs == 1) { 966 if (fi->fib_nhs == 1) {
967 if (fi->fib_nh->nh_gw) 967 if (fi->fib_nh->nh_gw)
968 NLA_PUT_U32(skb, RTA_GATEWAY, fi->fib_nh->nh_gw); 968 NLA_PUT_BE32(skb, RTA_GATEWAY, fi->fib_nh->nh_gw);
969 969
970 if (fi->fib_nh->nh_oif) 970 if (fi->fib_nh->nh_oif)
971 NLA_PUT_U32(skb, RTA_OIF, fi->fib_nh->nh_oif); 971 NLA_PUT_U32(skb, RTA_OIF, fi->fib_nh->nh_oif);
@@ -993,7 +993,7 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
993 rtnh->rtnh_ifindex = nh->nh_oif; 993 rtnh->rtnh_ifindex = nh->nh_oif;
994 994
995 if (nh->nh_gw) 995 if (nh->nh_gw)
996 NLA_PUT_U32(skb, RTA_GATEWAY, nh->nh_gw); 996 NLA_PUT_BE32(skb, RTA_GATEWAY, nh->nh_gw);
997#ifdef CONFIG_NET_CLS_ROUTE 997#ifdef CONFIG_NET_CLS_ROUTE
998 if (nh->nh_tclassid) 998 if (nh->nh_tclassid)
999 NLA_PUT_U32(skb, RTA_FLOW, nh->nh_tclassid); 999 NLA_PUT_U32(skb, RTA_FLOW, nh->nh_tclassid);