mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
MPLS: Fix pointer manipulation when forming netlink nested attributes
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Fixes: f128f2f1f8a2fa975063dd321719607693991eb0 Ticket: CM-10506 Reviewed By: CCR-4536 Testing Done: Manual verification
This commit is contained in:
parent
c0f4be83a1
commit
27559ebdeb
@ -101,6 +101,16 @@ static const struct message nlmsg_str[] = {
|
|||||||
#endif
|
#endif
|
||||||
/* End of temporary definitions */
|
/* End of temporary definitions */
|
||||||
|
|
||||||
|
#ifndef NLMSG_TAIL
|
||||||
|
#define NLMSG_TAIL(nmsg) \
|
||||||
|
((struct rtattr *) (((u_char *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RTA_TAIL
|
||||||
|
#define RTA_TAIL(rta) \
|
||||||
|
((struct rtattr *) (((u_char *) (rta)) + RTA_ALIGN((rta)->rta_len)))
|
||||||
|
#endif
|
||||||
|
|
||||||
struct gw_family_t
|
struct gw_family_t
|
||||||
{
|
{
|
||||||
u_int16_t filler;
|
u_int16_t filler;
|
||||||
@ -1749,7 +1759,7 @@ addattr_nest(struct nlmsghdr *n, int maxlen, int type)
|
|||||||
static int
|
static int
|
||||||
addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest)
|
addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest)
|
||||||
{
|
{
|
||||||
nest->rta_len = NLMSG_TAIL(n) - nest;
|
nest->rta_len = (u_char *)NLMSG_TAIL(n) - (u_char *)nest;
|
||||||
return n->nlmsg_len;
|
return n->nlmsg_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1765,7 +1775,7 @@ rta_nest(struct rtattr *rta, int maxlen, int type)
|
|||||||
static int
|
static int
|
||||||
rta_nest_end(struct rtattr *rta, struct rtattr *nest)
|
rta_nest_end(struct rtattr *rta, struct rtattr *nest)
|
||||||
{
|
{
|
||||||
nest->rta_len = RTA_TAIL(rta) - nest;
|
nest->rta_len = (u_char *)RTA_TAIL(rta) - (u_char *)nest;
|
||||||
return rta->rta_len;
|
return rta->rta_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user