Hi!
Fixes are attached as patch following bird-md5.diff . Or should i send corrected original patches?
Please send corrected original patches, it will be easier to follow in the history.
BTW, in bgp_rte_better() we compare MEDs between routes from different ASes, although RFC says that MED is only comparable between routes learned from the same neighboring AS. Is this bug or some cleverness?
The same-AS rule has been introduced in RFC 4271, which is much newer than the BGP code in BIRD. The tie breaking algorithm in RFC 1771 compares MEDs even for different ASes. Feel free to update the rules to reflect the current RFC. (If you have time, could you please check all differences between the RFCs?)
diff -uprN bird-as4-md5old/nest/attrs.h bird-as4-md5/nest/attrs.h --- bird-as4-md5old/nest/attrs.h 2008-10-13 23:41:05.000000000 +0200 +++ bird-as4-md5/nest/attrs.h 2008-10-07 19:04:14.000000000 +0200 @@ -17,6 +17,9 @@ #define AS_PATH_MAXLEN 10000
#define AS_TRANS 23456 +/* AS_TRANS is used when we need to store 32bit ASN larger than 0xFFFF + * to 16bit slot (like in 16bit AS_PATH). See RFC 4893 for details + */
struct adata *as_path_prepend(struct linpool *pool, struct adata *olda, u32 as); int as_path_convert_to_old(struct adata *path, byte *dst, int *new_used);
This has probably crept from the other patch. Have a nice fortnight -- Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth Quidquid latine dictum sit, altum videtur.