assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
new->length = total;
assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
new->length = total;
assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
new->length = total;
assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_PROTO_TYPE;
new->length = total;
assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_COLOR;
new->length = total;
assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_IPSEC_TA;
new->length = total;
assert(total <= 0xff);
new = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
+ sizeof(struct bgp_attr_encap_subtlv) + total);
assert(new);
new->type = BGP_ENCAP_SUBTLV_TYPE_REMOTE_ENDPOINT;
new->length = total;
if (attr->encap_subtlvs)
XFREE(MTYPE_ENCAP_TLV, attr->encap_subtlvs);
tlv = XCALLOC(MTYPE_ENCAP_TLV,
- sizeof(struct bgp_attr_encap_subtlv) - 1 + 12);
+ sizeof(struct bgp_attr_encap_subtlv) + 12);
tlv->type = 1; /* encapsulation type */
tlv->length = 12;
if (bet->vnid) {