summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_te.c
diff options
context:
space:
mode:
authorOlivier Dugeon <olivier.dugeon@orange.com>2017-07-31 18:03:00 +0200
committerOlivier Dugeon <olivier.dugeon@orange.com>2017-07-31 18:03:00 +0200
commit5d0df50febdd73cf29783efb60b6f4d2f36a3fc9 (patch)
tree7ae554591cc6d727f248cded057594790728de7a /ospfd/ospf_te.c
parentCorrect code style as requested by review of PR839 (diff)
downloadfrr-5d0df50febdd73cf29783efb60b6f4d2f36a3fc9.tar.xz
frr-5d0df50febdd73cf29783efb60b6f4d2f36a3fc9.zip
Correct build TLV functions
* Functions that build TLVs in ospf_te.c and ospf_te.c use 'tlvh + 1' to move the pointer to the TLV payload ifor strem_put(). * Correct this by using TLV_DATA() macro which is saffer. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_te.c')
-rw-r--r--ospfd/ospf_te.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 521844b9e..482d9d48c 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -1065,7 +1065,7 @@ static void build_router_tlv(struct stream *s)
struct tlv_header *tlvh = &OspfMplsTE.router_addr.header;
if (ntohs(tlvh->type) != 0) {
build_tlv_header(s, tlvh);
- stream_put(s, tlvh + 1, TLV_BODY_SIZE(tlvh));
+ stream_put(s, TLV_DATA(tlvh), TLV_BODY_SIZE(tlvh));
}
return;
}
@@ -1075,7 +1075,7 @@ static void build_link_subtlv(struct stream *s, struct tlv_header *tlvh)
if ((tlvh != NULL) && (ntohs(tlvh->type) != 0)) {
build_tlv_header(s, tlvh);
- stream_put(s, tlvh + 1, TLV_BODY_SIZE(tlvh));
+ stream_put(s, TLV_DATA(tlvh), TLV_BODY_SIZE(tlvh));
}
return;
}
@@ -2141,7 +2141,7 @@ static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa)
case TE_TLV_LINK:
sum += show_vty_link_header(vty, tlvh);
subfunc = ospf_mpls_te_show_link_subtlv;
- next = tlvh + 1;
+ next = TLV_DATA(tlvh);
break;
default:
sum += show_vty_unknown_tlv(vty, tlvh);