aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-27 01:16:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:01:04 -0400
commita7a628c442ed28511e1569a975c993b27fa034f4 (patch)
treef0fa844d3a742afbfff63c9a83919a44b8ae8d92
parenta144ea4b7a13087081ab5402fa9ad0bcfd249e67 (diff)
[IPV4]: IFA_{LOCAL,ADDRESS,BROADCAST,ANYCAST} on ipv4 annotated
use be32 netlink accessors Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/devinet.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a0a7780e7515..afba56222fb5 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -467,7 +467,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
467 for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL; 467 for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
468 ifap = &ifa->ifa_next) { 468 ifap = &ifa->ifa_next) {
469 if (tb[IFA_LOCAL] && 469 if (tb[IFA_LOCAL] &&
470 ifa->ifa_local != nla_get_u32(tb[IFA_LOCAL])) 470 ifa->ifa_local != nla_get_be32(tb[IFA_LOCAL]))
471 continue; 471 continue;
472 472
473 if (tb[IFA_LABEL] && nla_strcmp(tb[IFA_LABEL], ifa->ifa_label)) 473 if (tb[IFA_LABEL] && nla_strcmp(tb[IFA_LABEL], ifa->ifa_label))
@@ -475,7 +475,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
475 475
476 if (tb[IFA_ADDRESS] && 476 if (tb[IFA_ADDRESS] &&
477 (ifm->ifa_prefixlen != ifa->ifa_prefixlen || 477 (ifm->ifa_prefixlen != ifa->ifa_prefixlen ||
478 !inet_ifa_match(nla_get_u32(tb[IFA_ADDRESS]), ifa))) 478 !inet_ifa_match(nla_get_be32(tb[IFA_ADDRESS]), ifa)))
479 continue; 479 continue;
480 480
481 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).pid); 481 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).pid);
@@ -540,14 +540,14 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
540 ifa->ifa_scope = ifm->ifa_scope; 540 ifa->ifa_scope = ifm->ifa_scope;
541 ifa->ifa_dev = in_dev; 541 ifa->ifa_dev = in_dev;
542 542
543 ifa->ifa_local = nla_get_u32(tb[IFA_LOCAL]); 543 ifa->ifa_local = nla_get_be32(tb[IFA_LOCAL]);
544 ifa->ifa_address = nla_get_u32(tb[IFA_ADDRESS]); 544 ifa->ifa_address = nla_get_be32(tb[IFA_ADDRESS]);
545 545
546 if (tb[IFA_BROADCAST]) 546 if (tb[IFA_BROADCAST])
547 ifa->ifa_broadcast = nla_get_u32(tb[IFA_BROADCAST]); 547 ifa->ifa_broadcast = nla_get_be32(tb[IFA_BROADCAST]);
548 548
549 if (tb[IFA_ANYCAST]) 549 if (tb[IFA_ANYCAST])
550 ifa->ifa_anycast = nla_get_u32(tb[IFA_ANYCAST]); 550 ifa->ifa_anycast = nla_get_be32(tb[IFA_ANYCAST]);
551 551
552 if (tb[IFA_LABEL]) 552 if (tb[IFA_LABEL])
553 nla_strlcpy(ifa->ifa_label, tb[IFA_LABEL], IFNAMSIZ); 553 nla_strlcpy(ifa->ifa_label, tb[IFA_LABEL], IFNAMSIZ);
@@ -1138,16 +1138,16 @@ static int inet_fill_ifaddr(struct sk_buff *skb, struct in_ifaddr *ifa,
1138 ifm->ifa_index = ifa->ifa_dev->dev->ifindex; 1138 ifm->ifa_index = ifa->ifa_dev->dev->ifindex;
1139 1139
1140 if (ifa->ifa_address) 1140 if (ifa->ifa_address)
1141 NLA_PUT_U32(skb, IFA_ADDRESS, ifa->ifa_address); 1141 NLA_PUT_BE32(skb, IFA_ADDRESS, ifa->ifa_address);
1142 1142
1143 if (ifa->ifa_local) 1143 if (ifa->ifa_local)
1144 NLA_PUT_U32(skb, IFA_LOCAL, ifa->ifa_local); 1144 NLA_PUT_BE32(skb, IFA_LOCAL, ifa->ifa_local);
1145 1145
1146 if (ifa->ifa_broadcast) 1146 if (ifa->ifa_broadcast)
1147 NLA_PUT_U32(skb, IFA_BROADCAST, ifa->ifa_broadcast); 1147 NLA_PUT_BE32(skb, IFA_BROADCAST, ifa->ifa_broadcast);
1148 1148
1149 if (ifa->ifa_anycast) 1149 if (ifa->ifa_anycast)
1150 NLA_PUT_U32(skb, IFA_ANYCAST, ifa->ifa_anycast); 1150 NLA_PUT_BE32(skb, IFA_ANYCAST, ifa->ifa_anycast);
1151 1151
1152 if (ifa->ifa_label[0]) 1152 if (ifa->ifa_label[0])
1153 NLA_PUT_STRING(skb, IFA_LABEL, ifa->ifa_label); 1153 NLA_PUT_STRING(skb, IFA_LABEL, ifa->ifa_label);