u32: add const to rtnl_u32_add_key_in*_addr()

Cc: Thomas Haller <thaller@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Cong Wang 2014-03-20 10:24:12 -07:00 committed by Thomas Haller
parent 67a704676c
commit c0a5b39308
2 changed files with 4 additions and 4 deletions

View file

@ -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 *);

View file

@ -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;