Commit 8e24b2bd authored by Pavel Tvrdik's avatar Pavel Tvrdik
Browse files

bgpsec-mbaer: simple after merge fixes

parent f857f674
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@
#define MAX(a,b) MAX_(a,b)
#endif

#ifndef U64
#define U64(c) UINT64_C(c)
#endif
#define ABS(a)   ((a)>=0 ? (a) : -(a))
#define DELTA(a,b) (((a)>=(b))?(a)-(b):(b)-(a))
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a)))
+8 −3
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ decode_bgpsec_attr(struct bgp_proto *bgp,
     p, err, path_id, prefix, pxlen and goto 'done:'  */
  int         err = 0;
  u32     path_id = 0;
  ip_addr  prefix = 0;
  ip_addr  prefix = IPA_NONE;
  int       pxlen = 0;

  /* Is it long enough to have a minimal valid bgpseg_path_attr */
@@ -2433,14 +2433,16 @@ bgp_remove_as4_attrs(struct bgp_proto *p, rta *a)
 * @len: length of attribute block
 * @pool: linear pool to make all the allocations in
 * @mandatory: 1 iff presence of mandatory attributes has to be checked
 * @nlri: FIXME
 * @nlri_len: FIXME
 *
 * This function takes a BGP attribute block (a part of an Update message), checks
 * its consistency and converts it to a list of BIRD route attributes represented
 * by a &rta.
 */
struct rta *
bgp_decode_attrs(struct bgp_conn *conn, byte *attr, uint len, struct linpool *pool, int mandatory,
		 byte *nlri, int nlri_len)
bgp_decode_attrs(struct bgp_conn *conn, byte *attr, unsigned int len,
                 struct linpool *pool,  int mandatory, byte *nlri, int nlri_len)
{
  struct bgp_proto *bgp = conn->bgp;
  rta *a = lp_alloc(pool, sizeof(struct rta));
@@ -2754,3 +2756,6 @@ bgp_get_route_info(rte *e, byte *buf, ea_list *attrs)
    buf += bsprintf(buf, "%c", "ie?"[o->u.data]);
  strcpy(buf, "]");
}


+1 −1
Original line number Diff line number Diff line
@@ -1371,7 +1371,7 @@ bgp_check_config(struct bgp_config *c)
#ifdef CONFIG_BGPSEC
  /* create a binary SKI from config */
  if ( c->enable_bgpsec ) {
    if ( strnlen(c->bgpsec_ski, (2 * BGPSEC_SKI_LENGTH))
    if ( c->bgpsec_ski == NULL || strnlen(c->bgpsec_ski, (2 * BGPSEC_SKI_LENGTH))
	 != (BGPSEC_SKI_LENGTH * 2) ) {
      cf_error("BGPSEC: bad length of the configured SKI value");
    }
+6 −1
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ static inline void set_next_hop(byte *b, ip_addr addr) { ((ip_addr *) b)[0] = ad

void bgp_attach_attr(struct ea_list **to, struct linpool *pool, unsigned attr, uintptr_t val);
byte *bgp_attach_attr_wa(struct ea_list **to, struct linpool *pool, unsigned attr, unsigned len);
struct rta *bgp_decode_attrs(struct bgp_conn *conn, byte *a, uint len, struct linpool *pool, int mandatory, byte * nlri, int nlri_len);
struct rta *bgp_decode_attrs(struct bgp_conn *conn, byte *attr, unsigned int len, struct linpool *pool, int mandatory, byte * nlri, int nlri_len);
int bgp_get_attr(struct eattr *e, byte *buf, int buflen);
int bgp_rte_better(struct rte *, struct rte *);
int bgp_rte_mergable(rte *pri, rte *sec);
@@ -317,6 +317,11 @@ void bgp_get_route_info(struct rte *, byte *buf, struct ea_list *attrs);
inline static void bgp_attach_attr_ip(struct ea_list **to, struct linpool *pool, unsigned attr, ip_addr a)
{ *(ip_addr *) bgp_attach_attr_wa(to, pool, attr, sizeof(ip_addr)) = a; }

#ifdef CONFIG_BGPSEC
unsigned int encode_bgpsec_attr(struct  bgp_conn  *conn, ea_list *attr_list, byte *w, int remains, byte *nlri);
#endif


/* packets.c */

void mrt_dump_bgp_state_change(struct bgp_conn *conn, unsigned old, unsigned new);
+1 −0
Original line number Diff line number Diff line
@@ -9,3 +9,4 @@ validate_tmp.o: ../../../../proto/bgp/bgpsec/validate.c

tests: tests.o validate_tmp.o
	gcc -o $@ $^ bgpsec.o $(LDFLAGS) $(LIBS)
Loading