[Patch] u32: add const to rtnl_u32_add_key_in*_addr()
Cong Wang
xiyou.wangcong at gmail.com
Thu Mar 20 13:24:12 EDT 2014
Cc: Thomas Haller <thaller at redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
---
diff --git a/include/netlink/route/cls/u32.h b/include/netlink/route/cls/u32.h
index a74bfcd..f35d37a 100644
--- a/include/netlink/route/cls/u32.h
+++ b/include/netlink/route/cls/u32.h
@@ -40,9 +40,9 @@ extern int rtnl_u32_add_key_uint16(struct rtnl_cls *, uint16_t, uint16_t,
int, int);
extern int rtnl_u32_add_key_uint32(struct rtnl_cls *, uint32_t, uint32_t,
int, int);
-extern int rtnl_u32_add_key_in_addr(struct rtnl_cls *, struct in_addr *,
+extern int rtnl_u32_add_key_in_addr(struct rtnl_cls *, const struct in_addr *,
uint8_t, int, int);
-extern int rtnl_u32_add_key_in6_addr(struct rtnl_cls *, struct in6_addr *,
+extern int rtnl_u32_add_key_in6_addr(struct rtnl_cls *, const struct in6_addr *,
uint8_t, int, int);
extern int rtnl_u32_add_action(struct rtnl_cls *, struct rtnl_act *);
extern int rtnl_u32_del_action(struct rtnl_cls *, struct rtnl_act *);
diff --git a/lib/route/cls/u32.c b/lib/route/cls/u32.c
index d303d4b..52ab263 100644
--- a/lib/route/cls/u32.c
+++ b/lib/route/cls/u32.c
@@ -645,14 +645,14 @@ int rtnl_u32_add_key_uint32(struct rtnl_cls *cls, uint32_t val, uint32_t mask,
off & ~3, offmask);
}
-int rtnl_u32_add_key_in_addr(struct rtnl_cls *cls, struct in_addr *addr,
+int rtnl_u32_add_key_in_addr(struct rtnl_cls *cls, const struct in_addr *addr,
uint8_t bitmask, int off, int offmask)
{
uint32_t mask = 0xFFFFFFFF << (32 - bitmask);
return rtnl_u32_add_key(cls, addr->s_addr, htonl(mask), off, offmask);
}
-int rtnl_u32_add_key_in6_addr(struct rtnl_cls *cls, struct in6_addr *addr,
+int rtnl_u32_add_key_in6_addr(struct rtnl_cls *cls, const struct in6_addr *addr,
uint8_t bitmask, int off, int offmask)
{
int i, err;
More information about the libnl
mailing list