summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-08 16:31:24 +0200
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-08 16:31:24 +0200
commit6926a30b14d1f0c2905925d0e886d5a8ee1689de (patch)
treeb5d5d95721dcd9bf8c1912103c55df62ca6d6594 /zebra/rt_netlink.c
parent0cea0fcb275da25db3577a07b0a6b2a0613cc9b2 (diff)
downloadquagga-6926a30b14d1f0c2905925d0e886d5a8ee1689de.tar.bz2
quagga-6926a30b14d1f0c2905925d0e886d5a8ee1689de.tar.xz
netlink message signed/unsigned cleanup
Avoid possible problems where netlink message is being formatted with unsigned 32 bit value, which was being read as int.
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 0a464f92..12978c4e 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -474,7 +474,7 @@ netlink_interface (struct sockaddr_nl *snl, struct nlmsghdr *h)
}
strncpy(ifp->name, name, INTERFACE_NAMSIZ);
ifp->flags = ifi->ifi_flags & 0x0000fffff;
- ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
+ ifp->mtu6 = ifp->mtu = *(uint32_t *) RTA_DATA (tb[IFLA_MTU]);
ifp->metric = 1;
/* Hardware type and address. */
@@ -720,7 +720,7 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h)
src = NULL;
if (tb[RTA_OIF])
- index = *(int *) RTA_DATA (tb[RTA_OIF]);
+ index = *(uint32_t *) RTA_DATA (tb[RTA_OIF]);
if (tb[RTA_DST])
dest = RTA_DATA (tb[RTA_DST]);
@@ -735,7 +735,7 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h)
gate = RTA_DATA (tb[RTA_GATEWAY]);
if (tb[RTA_PRIORITY])
- metric = *(int *) RTA_DATA(tb[RTA_PRIORITY]);
+ metric = *(uint32_t *) RTA_DATA(tb[RTA_PRIORITY]);
if (rtm->rtm_family == AF_INET)
{
@@ -852,7 +852,7 @@ netlink_route_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
src = NULL;
if (tb[RTA_OIF])
- index = *(int *) RTA_DATA (tb[RTA_OIF]);
+ index = *(uint32_t *) RTA_DATA (tb[RTA_OIF]);
if (tb[RTA_DST])
dest = RTA_DATA (tb[RTA_DST]);
@@ -988,7 +988,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
name, ifi->ifi_index, if_flag_dump(new_flags));
ifp->flags = new_flags;
- ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
+ ifp->mtu6 = ifp->mtu = *(uint32_t *) RTA_DATA (tb[IFLA_MTU]);
/* If new link is added. */
if_add_update (ifp);
@@ -996,7 +996,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h)
else
{
/* Interface status change. */
- ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]);
+ ifp->mtu6 = ifp->mtu = *(uint32_t *) RTA_DATA (tb[IFLA_MTU]);
if (new_flags != ifp->flags)
{