mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 23:48:11 +00:00
Merge pull request #1339 from donaldsharp/bgp_compile_issues
Bgp compile issues
This commit is contained in:
commit
6a3a74d817
@ -208,7 +208,7 @@ struct bgp_attr_encap_subtlv *encap_tlv_dup(struct bgp_attr_encap_subtlv *orig)
|
|||||||
struct bgp_attr_encap_subtlv *p;
|
struct bgp_attr_encap_subtlv *p;
|
||||||
|
|
||||||
for (p = orig, tail = new = NULL; p; p = p->next) {
|
for (p = orig, tail = new = NULL; p; p = p->next) {
|
||||||
int size = sizeof(struct bgp_attr_encap_subtlv) - 1 + p->length;
|
int size = sizeof(struct bgp_attr_encap_subtlv) + p->length;
|
||||||
if (tail) {
|
if (tail) {
|
||||||
tail->next = XCALLOC(MTYPE_ENCAP_TLV, size);
|
tail->next = XCALLOC(MTYPE_ENCAP_TLV, size);
|
||||||
tail = tail->next;
|
tail = tail->next;
|
||||||
@ -1916,7 +1916,7 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */
|
|||||||
/* alloc and copy sub-tlv */
|
/* alloc and copy sub-tlv */
|
||||||
/* TBD make sure these are freed when attributes are released */
|
/* TBD make sure these are freed when attributes are released */
|
||||||
tlv = XCALLOC(MTYPE_ENCAP_TLV,
|
tlv = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1
|
sizeof(struct bgp_attr_encap_subtlv)
|
||||||
+ sublength);
|
+ sublength);
|
||||||
tlv->type = subtype;
|
tlv->type = subtype;
|
||||||
tlv->length = sublength;
|
tlv->length = sublength;
|
||||||
|
@ -47,7 +47,7 @@ static struct bgp_attr_encap_subtlv *subtlv_encode_encap_l2tpv3_over_ip(
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -72,7 +72,7 @@ subtlv_encode_encap_gre(struct bgp_tea_subtlv_encap_gre_key *st)
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -95,7 +95,7 @@ subtlv_encode_encap_pbb(struct bgp_tea_subtlv_encap_pbb *st)
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_ENCAPSULATION;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -128,7 +128,7 @@ subtlv_encode_proto_type(struct bgp_tea_subtlv_proto_type *st)
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_PROTO_TYPE;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_PROTO_TYPE;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -150,7 +150,7 @@ subtlv_encode_color(struct bgp_tea_subtlv_color *st)
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_COLOR;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_COLOR;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -182,7 +182,7 @@ subtlv_encode_ipsec_ta(struct bgp_tea_subtlv_ipsec_ta *st)
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_IPSEC_TA;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_IPSEC_TA;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -206,7 +206,7 @@ subtlv_encode_remote_endpoint(struct bgp_tea_subtlv_remote_endpoint *st)
|
|||||||
assert(total <= 0xff);
|
assert(total <= 0xff);
|
||||||
|
|
||||||
new = XCALLOC(MTYPE_ENCAP_TLV,
|
new = XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + total);
|
sizeof(struct bgp_attr_encap_subtlv) + total);
|
||||||
assert(new);
|
assert(new);
|
||||||
new->type = BGP_ENCAP_SUBTLV_TYPE_REMOTE_ENDPOINT;
|
new->type = BGP_ENCAP_SUBTLV_TYPE_REMOTE_ENDPOINT;
|
||||||
new->length = total;
|
new->length = total;
|
||||||
@ -404,7 +404,7 @@ void bgp_encap_type_vxlan_to_tlv(
|
|||||||
if (attr->encap_subtlvs)
|
if (attr->encap_subtlvs)
|
||||||
XFREE(MTYPE_ENCAP_TLV, attr->encap_subtlvs);
|
XFREE(MTYPE_ENCAP_TLV, attr->encap_subtlvs);
|
||||||
tlv = XCALLOC(MTYPE_ENCAP_TLV,
|
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->type = 1; /* encapsulation type */
|
||||||
tlv->length = 12;
|
tlv->length = 12;
|
||||||
if (bet->vnid) {
|
if (bet->vnid) {
|
||||||
|
@ -230,8 +230,8 @@ static void display_vni(struct vty *vty, struct bgpevpn *vpn, json_object *json)
|
|||||||
char *ecom_str;
|
char *ecom_str;
|
||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
struct ecommunity *ecom;
|
struct ecommunity *ecom;
|
||||||
json_object *json_import_rtl;
|
json_object *json_import_rtl = NULL;
|
||||||
json_object *json_export_rtl;
|
json_object *json_export_rtl = NULL;
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
json_import_rtl = json_object_new_array();
|
json_import_rtl = json_object_new_array();
|
||||||
|
@ -757,7 +757,7 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */
|
|||||||
|
|
||||||
encaptlv =
|
encaptlv =
|
||||||
XCALLOC(MTYPE_ENCAP_TLV,
|
XCALLOC(MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1 + 4);
|
sizeof(struct bgp_attr_encap_subtlv) + 4);
|
||||||
assert(encaptlv);
|
assert(encaptlv);
|
||||||
encaptlv->type =
|
encaptlv->type =
|
||||||
BGP_VNC_SUBTLV_TYPE_LIFETIME; /* prefix lifetime */
|
BGP_VNC_SUBTLV_TYPE_LIFETIME; /* prefix lifetime */
|
||||||
@ -801,8 +801,8 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */
|
|||||||
*/
|
*/
|
||||||
encaptlv = XCALLOC(
|
encaptlv = XCALLOC(
|
||||||
MTYPE_ENCAP_TLV,
|
MTYPE_ENCAP_TLV,
|
||||||
sizeof(struct bgp_attr_encap_subtlv) - 1
|
sizeof(struct bgp_attr_encap_subtlv)
|
||||||
+ 2 + hop->length);
|
+ 2 + hop->length);
|
||||||
assert(encaptlv);
|
assert(encaptlv);
|
||||||
encaptlv->type =
|
encaptlv->type =
|
||||||
BGP_VNC_SUBTLV_TYPE_RFPOPTION; /* RFP
|
BGP_VNC_SUBTLV_TYPE_RFPOPTION; /* RFP
|
||||||
|
Loading…
Reference in New Issue
Block a user