]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '48cf5e84e6ed17578e4ad43c5ef54d6ff7d825c4' into integrated
authorOndrej Zajicek <santiago@crfreenet.org>
Sat, 12 Jan 2013 21:13:22 +0000 (22:13 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sat, 12 Jan 2013 21:13:22 +0000 (22:13 +0100)
1  2 
conf/cf-lex.l
conf/conf.c
lib/socket.h
nest/config.Y
nest/route.h
nest/rt-table.c
proto/bgp/attrs.c
proto/radv/packets.c
proto/radv/radv.h
sysdep/unix/io.c

diff --cc conf/cf-lex.l
index a46262274715eb8be876c6ed8e3224867fd78409,c8eae0e87652167d2ce09574f072a99ceafc5473..8db0dc1c733565798bc8767bd98b3db5f6761efd
@@@ -103,12 -105,34 +105,28 @@@ WHITE [ \t
  include   ^{WHITE}*include{WHITE}*\".*\"{WHITE}*;
  
  %%
- {include} { if(cf_open_hook) new_include(); }
+ {include} {
+   char *start, *end;
+   if (!ifs->depth)
+     cf_error("Include not allowed in CLI");
+   start = strchr(yytext, '"');
+   start++;
+   end = strchr(start, '"');
+   *end = 0;
+   if (start == end)
+     cf_error("Include with empty argument");
+   cf_include(start, end-start);
+ }
  
  {DIGIT}+\.{DIGIT}+\.{DIGIT}+\.{DIGIT}+ {
 -#ifdef IPV6
 -  if (ipv4_pton_u32(yytext, &cf_lval.i32))
 -    return RTRID;
 +  if (ip4_pton(yytext, &cf_lval.a4))
 +    return IP4;
    cf_error("Invalid IPv4 address %s", yytext);
 -#else
 -  if (ip_pton(yytext, &cf_lval.a))
 -    return IPA;
 -  cf_error("Invalid IP address %s", yytext);
 -#endif
  }
  
  ({XIGIT}*::|({XIGIT}*:){3,})({XIGIT}*|{DIGIT}+\.{DIGIT}+\.{DIGIT}+\.{DIGIT}+) {
diff --cc conf/conf.c
Simple merge
diff --cc lib/socket.h
Simple merge
diff --cc nest/config.Y
index cda60f4749105528c94a0037f89b2fad92c5b457,a75dd0c34846a806913b713eab6b8463cd8451f5..4b9ba84f838590dc2d46536fdd3101b5eb9012d0
@@@ -44,11 -44,10 +44,11 @@@ CF_DECL
  
  CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
  CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
 +CF_KEYWORDS(IPV4, IPVX, VPN4, VPN6, MPLS)
  CF_KEYWORDS(LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE)
  CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
 -CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE, ROA, MAX, FLUSH)
 +CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE, ROA, AS, MAX, FLUSH)
- CF_KEYWORDS(LISTEN, BGP, V6ONLY, DUAL, ADDRESS, PORT, PASSWORDS, DESCRIPTION)
+ CF_KEYWORDS(LISTEN, BGP, V6ONLY, DUAL, ADDRESS, PORT, PASSWORDS, DESCRIPTION, SORTED)
  CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC)
  
  CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
@@@ -66,7 -65,7 +66,7 @@@ CF_ENUM(T_ENUM_ROA, ROA_, UNKNOWN, VALI
  %type <ro> roa_args
  %type <rot> roa_table_arg
  %type <sd> sym_args
- %type <i> proto_start echo_mask echo_size debug_mask debug_list debug_flag mrtdump_mask mrtdump_list mrtdump_flag export_or_preexport roa_mode limit_action table_type
 -%type <i> proto_start echo_mask echo_size debug_mask debug_list debug_flag mrtdump_mask mrtdump_list mrtdump_flag export_or_preexport roa_mode limit_action tab_sorted
++%type <i> proto_start echo_mask echo_size debug_mask debug_list debug_flag mrtdump_mask mrtdump_list mrtdump_flag export_or_preexport roa_mode limit_action table_type table_sorted
  %type <ps> proto_patt proto_patt2
  %type <g> limit_spec
  
@@@ -106,20 -112,19 +106,28 @@@ listen_opt
  
  /* Creation of routing tables */
  
- CF_ADDTO(conf, newtab)
 -tab_sorted:
++CF_ADDTO(conf, table)
++
++table_sorted:
+           { $$ = 0; }
+  | SORTED { $$ = 1; }
+  ;
  
 -CF_ADDTO(conf, newtab)
 +table_type:
 +   /* empty */ { $$ = RT_IP; }
 + | IPV4 { $$ = RT_IPV4; }
 + | IPVX { $$ = RT_IPV6; } /* XXXX */
 + | VPN4 { $$ = RT_VPN4; }
 + | VPN6 { $$ = RT_VPN6; }
 + | MPLS { $$ = RT_MPLS; }
 + ;
  
- newtab: table_type TABLE SYM {
-   rt_new_table($3, $1);
- };
 -newtab: TABLE SYM tab_sorted {
++table: table_type TABLE SYM table_sorted {
+    struct rtable_config *cf;
 -   cf = rt_new_table($2);
 -   cf->sorted = $3;
++   cf = rt_new_table($3, $1);
++   cf->sorted = $4;
+    }
+  ;
  
  CF_ADDTO(conf, roa_table)
  
diff --cc nest/route.h
index b57d51812b2a414d6b01dc5aa718634fb6f4f99e,524e69b3c0d27ec21cc3ab0a36b595bfe6d6f960..ffae8457da5f77e3807403dda916ca10a5787bf3
@@@ -239,33 -220,12 +240,34 @@@ typedef struct rte 
    } u;
  } rte;
  
- #define REF_COW 1                     /* Copy this rte on write */
+ #define REF_COW               1               /* Copy this rte on write */
  
 +/* Types of routing tables/entries */
 +#define RT_IPV4               1
 +#define RT_IPV6               2
 +#define RT_VPN4               3
 +#define RT_VPN6               4
 +#define RT_MPLS               5
 +
 +#define RT_MAX                6
 +
 +/* Same tables using bit positions. Used for appropriate table linking on protocol init */
 +#define RTB_IPV4      (1 << RT_IPV4)
 +#define RTB_IPV6      (1 << RT_IPV6)
 +#define RTB_VPN4      (1 << RT_VPN4)
 +#define RTB_VPN6      (1 << RT_VPN6)
 +#define RTB_MPLS      (1 << RT_MPLS)
 +
 +#define RTB_IP                (RTB_IPV4 | RTB_IPV6)
 +
 +// XXXX these should probably go away, check their users
 +#define RT_IP         RT_IPV6
 +
 +
  /* Types of route announcement, also used as flags */
  #define RA_OPTIMAL    1               /* Announcement of optimal route change */
- #define RA_ANY                2               /* Announcement of any route change */
+ #define RA_ACCEPTED   2               /* Announcement of first accepted route */
+ #define RA_ANY                3               /* Announcement of any route change */
  
  struct config;
  
diff --cc nest/rt-table.c
index 1c17146e00e2bce11d0d976fef1ff5d3add165da,118f4c25b710d40d0252d35ea49343941e32e401..6a31000ea1ccfed1f6e18bed124b0846cb3fe39f
@@@ -1276,8 -1384,12 +1448,12 @@@ rt_next_hop_update(rtable *tab
  
  
  struct rtable_config *
 -rt_new_table(struct symbol *s)
 +rt_new_table(struct symbol *s, int addr_type)
  {
+   /* Hack that allows to 'redefine' the master table */
+   if ((s->class == SYM_TABLE) && (s->def == new_config->master_rtc))
+     return s->def;
    struct rtable_config *c = cfg_allocz(sizeof(struct rtable_config));
  
    cf_define_symbol(s, SYM_TABLE, c);
Simple merge
Simple merge
Simple merge
Simple merge