Skip to content

Commit 97edb7a

Browse files
authored
Merge branch 'FRRouting:master' into master
2 parents afa2b3c + f8abf96 commit 97edb7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1615
-588
lines changed

bgpd/bgp_clist.c

+19-25
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,9 @@ int community_list_set(struct community_list_handler *ch, const char *name,
904904
}
905905

906906
/* Unset community-list */
907-
int community_list_unset(struct community_list_handler *ch, const char *name,
908-
const char *str, const char *seq, int direct,
909-
int style)
907+
void community_list_unset(struct community_list_handler *ch, const char *name,
908+
const char *str, const char *seq, int direct,
909+
int style)
910910
{
911911
struct community_list_master *cm = NULL;
912912
struct community_entry *entry = NULL;
@@ -916,14 +916,14 @@ int community_list_unset(struct community_list_handler *ch, const char *name,
916916
/* Lookup community list. */
917917
list = community_list_lookup(ch, name, 0, COMMUNITY_LIST_MASTER);
918918
if (list == NULL)
919-
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
919+
return;
920920

921921
cm = community_list_master_lookup(ch, COMMUNITY_LIST_MASTER);
922922
/* Delete all of entry belongs to this community-list. */
923923
if (!str) {
924924
community_list_delete(cm, list);
925925
route_map_notify_dependencies(name, RMAP_EVENT_CLIST_DELETED);
926-
return 0;
926+
return;
927927
}
928928

929929
if (style == COMMUNITY_LIST_STANDARD)
@@ -936,12 +936,10 @@ int community_list_unset(struct community_list_handler *ch, const char *name,
936936
entry = community_list_entry_lookup(list, str, direct);
937937

938938
if (!entry)
939-
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
939+
return;
940940

941941
community_list_entry_delete(cm, list, entry);
942942
route_map_notify_dependencies(name, RMAP_EVENT_CLIST_DELETED);
943-
944-
return 0;
945943
}
946944

947945
bool lcommunity_list_any_match(struct lcommunity *lcom,
@@ -1172,9 +1170,9 @@ int lcommunity_list_set(struct community_list_handler *ch, const char *name,
11721170

11731171
/* Unset community-list. When str is NULL, delete all of
11741172
community-list entry belongs to the specified name. */
1175-
int lcommunity_list_unset(struct community_list_handler *ch, const char *name,
1176-
const char *str, const char *seq, int direct,
1177-
int style)
1173+
void lcommunity_list_unset(struct community_list_handler *ch, const char *name,
1174+
const char *str, const char *seq, int direct,
1175+
int style)
11781176
{
11791177
struct community_list_master *cm = NULL;
11801178
struct community_entry *entry = NULL;
@@ -1185,14 +1183,14 @@ int lcommunity_list_unset(struct community_list_handler *ch, const char *name,
11851183
/* Lookup community list. */
11861184
list = community_list_lookup(ch, name, 0, LARGE_COMMUNITY_LIST_MASTER);
11871185
if (list == NULL)
1188-
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
1186+
return;
11891187

11901188
cm = community_list_master_lookup(ch, LARGE_COMMUNITY_LIST_MASTER);
11911189
/* Delete all of entry belongs to this community-list. */
11921190
if (!str) {
11931191
community_list_delete(cm, list);
11941192
route_map_notify_dependencies(name, RMAP_EVENT_LLIST_DELETED);
1195-
return 0;
1193+
return;
11961194
}
11971195

11981196
if (style == LARGE_COMMUNITY_LIST_STANDARD)
@@ -1201,7 +1199,7 @@ int lcommunity_list_unset(struct community_list_handler *ch, const char *name,
12011199
regex = bgp_regcomp(str);
12021200

12031201
if (!lcom && !regex)
1204-
return COMMUNITY_LIST_ERR_MALFORMED_VAL;
1202+
return;
12051203

12061204
if (lcom)
12071205
entry = community_list_entry_lookup(list, lcom, direct);
@@ -1214,12 +1212,10 @@ int lcommunity_list_unset(struct community_list_handler *ch, const char *name,
12141212
bgp_regex_free(regex);
12151213

12161214
if (!entry)
1217-
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
1215+
return;
12181216

12191217
community_list_entry_delete(cm, list, entry);
12201218
route_map_notify_dependencies(name, RMAP_EVENT_LLIST_DELETED);
1221-
1222-
return 0;
12231219
}
12241220

12251221
/* Set extcommunity-list. */
@@ -1299,9 +1295,9 @@ int extcommunity_list_set(struct community_list_handler *ch, const char *name,
12991295
* When str is NULL, delete all extcommunity-list entries belonging to the
13001296
* specified name.
13011297
*/
1302-
int extcommunity_list_unset(struct community_list_handler *ch, const char *name,
1303-
const char *str, const char *seq, int direct,
1304-
int style)
1298+
void extcommunity_list_unset(struct community_list_handler *ch,
1299+
const char *name, const char *str, const char *seq,
1300+
int direct, int style)
13051301
{
13061302
struct community_list_master *cm = NULL;
13071303
struct community_entry *entry = NULL;
@@ -1311,14 +1307,14 @@ int extcommunity_list_unset(struct community_list_handler *ch, const char *name,
13111307
/* Lookup extcommunity list. */
13121308
list = community_list_lookup(ch, name, 0, EXTCOMMUNITY_LIST_MASTER);
13131309
if (list == NULL)
1314-
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
1310+
return;
13151311

13161312
cm = community_list_master_lookup(ch, EXTCOMMUNITY_LIST_MASTER);
13171313
/* Delete all of entry belongs to this extcommunity-list. */
13181314
if (!str) {
13191315
community_list_delete(cm, list);
13201316
route_map_notify_dependencies(name, RMAP_EVENT_ECLIST_DELETED);
1321-
return 0;
1317+
return;
13221318
}
13231319

13241320
if (style == EXTCOMMUNITY_LIST_STANDARD)
@@ -1331,12 +1327,10 @@ int extcommunity_list_unset(struct community_list_handler *ch, const char *name,
13311327
entry = community_list_entry_lookup(list, str, direct);
13321328

13331329
if (!entry)
1334-
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
1330+
return;
13351331

13361332
community_list_entry_delete(cm, list, entry);
13371333
route_map_notify_dependencies(name, RMAP_EVENT_ECLIST_DELETED);
1338-
1339-
return 0;
13401334
}
13411335

13421336
/* Initializa community-list. Return community-list handler. */

bgpd/bgp_clist.h

+12-14
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,9 @@ struct community_list_handler {
109109
};
110110

111111
/* Error code of community-list. */
112-
#define COMMUNITY_LIST_ERR_CANT_FIND_LIST -1
113-
#define COMMUNITY_LIST_ERR_MALFORMED_VAL -2
114-
#define COMMUNITY_LIST_ERR_STANDARD_CONFLICT -3
115-
#define COMMUNITY_LIST_ERR_EXPANDED_CONFLICT -4
116-
112+
#define COMMUNITY_LIST_ERR_MALFORMED_VAL -1
113+
#define COMMUNITY_LIST_ERR_STANDARD_CONFLICT -2
114+
#define COMMUNITY_LIST_ERR_EXPANDED_CONFLICT -3
117115
/* Handler. */
118116
extern struct community_list_handler *bgp_clist;
119117

@@ -124,22 +122,22 @@ extern void community_list_terminate(struct community_list_handler *ch);
124122
extern int community_list_set(struct community_list_handler *ch,
125123
const char *name, const char *str,
126124
const char *seq, int direct, int style);
127-
extern int community_list_unset(struct community_list_handler *ch,
128-
const char *name, const char *str,
129-
const char *seq, int direct, int style);
125+
extern void community_list_unset(struct community_list_handler *ch,
126+
const char *name, const char *str,
127+
const char *seq, int direct, int style);
130128
extern int extcommunity_list_set(struct community_list_handler *ch,
131129
const char *name, const char *str,
132130
const char *seq, int direct, int style);
133-
extern int extcommunity_list_unset(struct community_list_handler *ch,
134-
const char *name, const char *str,
135-
const char *seq, int direct, int style);
131+
extern void extcommunity_list_unset(struct community_list_handler *ch,
132+
const char *name, const char *str,
133+
const char *seq, int direct, int style);
136134
extern int lcommunity_list_set(struct community_list_handler *ch,
137135
const char *name, const char *str,
138136
const char *seq, int direct, int style);
139137
extern bool lcommunity_list_valid(const char *community, int style);
140-
extern int lcommunity_list_unset(struct community_list_handler *ch,
141-
const char *name, const char *str,
142-
const char *seq, int direct, int style);
138+
extern void lcommunity_list_unset(struct community_list_handler *ch,
139+
const char *name, const char *str,
140+
const char *seq, int direct, int style);
143141

144142
extern struct community_list_master *
145143
community_list_master_lookup(struct community_list_handler *ch, int master);

bgpd/bgp_mplsvpn.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -2240,8 +2240,9 @@ static void vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp, /* to */
22402240
* Let the kernel to decide with double lookup the real next-hop
22412241
* interface when installing the route.
22422242
*/
2243-
if (src_bgp || bpi_ultimate->sub_type == BGP_ROUTE_STATIC ||
2244-
bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE) {
2243+
if (src_vrf->vrf_id != VRF_DEFAULT &&
2244+
(src_bgp || bpi_ultimate->sub_type == BGP_ROUTE_STATIC ||
2245+
bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE)) {
22452246
ifp = if_get_vrf_loopback(src_vrf->vrf_id);
22462247
if (ifp)
22472248
static_attr.nh_ifindex = ifp->ifindex;

bgpd/bgp_open.c

+32-32
Original file line numberDiff line numberDiff line change
@@ -47,45 +47,45 @@ const struct message capcode_str[] = {
4747
};
4848

4949
/* Minimum sizes for length field of each cap (so not inc. the header) */
50-
static const size_t cap_minsizes[] = {
51-
[CAPABILITY_CODE_MP] = CAPABILITY_CODE_MP_LEN,
52-
[CAPABILITY_CODE_REFRESH] = CAPABILITY_CODE_REFRESH_LEN,
53-
[CAPABILITY_CODE_ORF] = CAPABILITY_CODE_ORF_LEN,
54-
[CAPABILITY_CODE_RESTART] = CAPABILITY_CODE_RESTART_LEN,
55-
[CAPABILITY_CODE_AS4] = CAPABILITY_CODE_AS4_LEN,
56-
[CAPABILITY_CODE_ADDPATH] = CAPABILITY_CODE_ADDPATH_LEN,
57-
[CAPABILITY_CODE_DYNAMIC] = CAPABILITY_CODE_DYNAMIC_LEN,
58-
[CAPABILITY_CODE_ENHE] = CAPABILITY_CODE_ENHE_LEN,
59-
[CAPABILITY_CODE_FQDN] = CAPABILITY_CODE_MIN_FQDN_LEN,
60-
[CAPABILITY_CODE_ENHANCED_RR] = CAPABILITY_CODE_ENHANCED_LEN,
61-
[CAPABILITY_CODE_EXT_MESSAGE] = CAPABILITY_CODE_EXT_MESSAGE_LEN,
62-
[CAPABILITY_CODE_LLGR] = CAPABILITY_CODE_LLGR_LEN,
63-
[CAPABILITY_CODE_ROLE] = CAPABILITY_CODE_ROLE_LEN,
64-
[CAPABILITY_CODE_SOFT_VERSION] = CAPABILITY_CODE_SOFT_VERSION_LEN,
65-
[CAPABILITY_CODE_PATHS_LIMIT] = CAPABILITY_CODE_PATHS_LIMIT_LEN,
50+
const size_t cap_minsizes[] = {
51+
[CAPABILITY_CODE_MP] = CAPABILITY_CODE_MP_LEN,
52+
[CAPABILITY_CODE_REFRESH] = CAPABILITY_CODE_REFRESH_LEN,
53+
[CAPABILITY_CODE_ORF] = CAPABILITY_CODE_ORF_LEN,
54+
[CAPABILITY_CODE_RESTART] = CAPABILITY_CODE_RESTART_LEN,
55+
[CAPABILITY_CODE_AS4] = CAPABILITY_CODE_AS4_LEN,
56+
[CAPABILITY_CODE_ADDPATH] = CAPABILITY_CODE_ADDPATH_LEN,
57+
[CAPABILITY_CODE_DYNAMIC] = CAPABILITY_CODE_DYNAMIC_LEN,
58+
[CAPABILITY_CODE_ENHE] = CAPABILITY_CODE_ENHE_LEN,
59+
[CAPABILITY_CODE_FQDN] = CAPABILITY_CODE_MIN_FQDN_LEN,
60+
[CAPABILITY_CODE_ENHANCED_RR] = CAPABILITY_CODE_ENHANCED_LEN,
61+
[CAPABILITY_CODE_EXT_MESSAGE] = CAPABILITY_CODE_EXT_MESSAGE_LEN,
62+
[CAPABILITY_CODE_LLGR] = CAPABILITY_CODE_LLGR_LEN,
63+
[CAPABILITY_CODE_ROLE] = CAPABILITY_CODE_ROLE_LEN,
64+
[CAPABILITY_CODE_SOFT_VERSION] = CAPABILITY_CODE_SOFT_VERSION_LEN,
65+
[CAPABILITY_CODE_PATHS_LIMIT] = CAPABILITY_CODE_PATHS_LIMIT_LEN,
6666
};
6767

6868
/* value the capability must be a multiple of.
6969
* 0-data capabilities won't be checked against this.
7070
* Other capabilities whose data doesn't fall on convenient boundaries for this
7171
* table should be set to 1.
7272
*/
73-
static const size_t cap_modsizes[] = {
74-
[CAPABILITY_CODE_MP] = 4,
75-
[CAPABILITY_CODE_REFRESH] = 1,
76-
[CAPABILITY_CODE_ORF] = 1,
77-
[CAPABILITY_CODE_RESTART] = 1,
78-
[CAPABILITY_CODE_AS4] = 4,
79-
[CAPABILITY_CODE_ADDPATH] = 4,
80-
[CAPABILITY_CODE_DYNAMIC] = 1,
81-
[CAPABILITY_CODE_ENHE] = 6,
82-
[CAPABILITY_CODE_FQDN] = 1,
83-
[CAPABILITY_CODE_ENHANCED_RR] = 1,
84-
[CAPABILITY_CODE_EXT_MESSAGE] = 1,
85-
[CAPABILITY_CODE_LLGR] = 1,
86-
[CAPABILITY_CODE_ROLE] = 1,
87-
[CAPABILITY_CODE_SOFT_VERSION] = 1,
88-
[CAPABILITY_CODE_PATHS_LIMIT] = 5,
73+
const size_t cap_modsizes[] = {
74+
[CAPABILITY_CODE_MP] = 4,
75+
[CAPABILITY_CODE_REFRESH] = 1,
76+
[CAPABILITY_CODE_ORF] = 1,
77+
[CAPABILITY_CODE_RESTART] = 1,
78+
[CAPABILITY_CODE_AS4] = 4,
79+
[CAPABILITY_CODE_ADDPATH] = 4,
80+
[CAPABILITY_CODE_DYNAMIC] = 1,
81+
[CAPABILITY_CODE_ENHE] = 6,
82+
[CAPABILITY_CODE_FQDN] = 1,
83+
[CAPABILITY_CODE_ENHANCED_RR] = 1,
84+
[CAPABILITY_CODE_EXT_MESSAGE] = 1,
85+
[CAPABILITY_CODE_LLGR] = 1,
86+
[CAPABILITY_CODE_ROLE] = 1,
87+
[CAPABILITY_CODE_SOFT_VERSION] = 1,
88+
[CAPABILITY_CODE_PATHS_LIMIT] = 5,
8989
};
9090

9191
/* BGP-4 Multiprotocol Extentions lead us to the complex world. We can

bgpd/bgp_open.h

+2
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,7 @@ extern as_t peek_for_as4_capability(struct peer *peer, uint16_t length);
112112
extern const struct message capcode_str[];
113113
extern const struct message orf_type_str[];
114114
extern const struct message orf_mode_str[];
115+
extern const size_t cap_minsizes[];
116+
extern const size_t cap_modsizes[];
115117

116118
#endif /* _QUAGGA_BGP_OPEN_H */

0 commit comments

Comments
 (0)