Thank you Denis, problem solved !
Le 03/12/2018 à 21:26, Denis Fondras a écrit :
> On Mon, Dec 03, 2018 at 09:19:10PM +0100, Denis Fondras wrote:
>> On Mon, Dec 03, 2018 at 05:59:26PM +0100, Julien Dhaille wrote:
>>> Hi. I am using bgpd within a rdomain (1).
>>> After the upgrade to 6.4 stable, I can’t announce prefixes anymore via
>>> bgpctl :
>>>
>>> router# ps aux -o rtable|grep bgp
>>>
>>> root 4039 0.0 0.1 300 1292 p0 S+p 5:12PM 0:00.00 grep
>>> bgp 0
>>> root 68170 0.0 0.2 1056 2060 p2 I+ 4:52PM 0:00.01 bgpd
>>> -dvv 1
>>> _bgpd 80238 0.0 0.4 4160 4264 p2 I+p 4:52PM 0:00.01 bgpd:
>>> route deci 1
>>> _bgpd 26255 0.0 0.2 1456 2164 p2 S+p 4:52PM 0:00.04 bgpd:
>>> session en 1
>>>
>>> router# route -T1 exec bgpctl network add 10.0.0.1/32 nexthop 10.0.0.20
>>> prepend-self 11
>>> or
>>> router# route -T1 exec bgpctl -s /var/run/bgpd.sock.1 network add
>>> 10.0.0.1/32 nexthop 10.0.0.20 prepend-self 11
>>>
>>> results in :
>>>
>>> network_add: prefix 10.0.0.1/32 in non-existing rdomain 0
>>>
>>> Am I missing a change or something ?
>>>
>>
>> rde.c,v1.389 from Jul 10, 2018 introduced this "regression".
>>
>> Can you try this diff :
>>
>
> Well, a bit too fast...
>
> Index: bgpctl.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.c,v
> retrieving revision 1.224
> diff -u -p -r1.224 bgpctl.c
> --- bgpctl.c 28 Nov 2018 08:33:59 -0000 1.224
> +++ bgpctl.c 3 Dec 2018 20:24:41 -0000
> @@ -101,6 +101,7 @@ const char *print_auth_method(enum auth_
> struct imsgbuf *ibuf;
> struct mrt_parser show_mrt = { show_mrt_dump, show_mrt_state, show_mrt_msg };
> struct mrt_parser net_mrt = { network_mrt_dump, NULL, NULL };
> +int tableid;
>
> __dead void
> usage(void)
> @@ -116,7 +117,7 @@ int
> main(int argc, char *argv[])
> {
> struct sockaddr_un sun;
> - int fd, n, done, ch, nodescr = 0, verbose = 0, r;
> + int fd, n, done, ch, nodescr = 0, verbose = 0;
> struct imsg imsg;
> struct network_config net;
> struct parse_result *res;
> @@ -128,8 +129,8 @@ main(int argc, char *argv[])
> if (pledge("stdio rpath wpath cpath unix inet dns", NULL) == -1)
> err(1, "pledge");
>
> - r = getrtable();
> - if (asprintf(&sockname, "%s.%d", SOCKET_NAME, r) == -1)
> + tableid = getrtable();
> + if (asprintf(&sockname, "%s.%d", SOCKET_NAME, tableid) == -1)
> err(1, "asprintf");
>
> while ((ch = getopt(argc, argv, "ns:")) != -1) {
> @@ -345,6 +346,7 @@ main(int argc, char *argv[])
> bzero(&net, sizeof(net));
> net.prefix = res->addr;
> net.prefixlen = res->prefixlen;
> + net.rtableid = tableid;
> /* attribute sets are not supported */
> if (res->action == NETWORK_ADD) {
> imsg_compose(ibuf, IMSG_NETWORK_ADD, 0, 0, -1,
> @@ -1981,6 +1983,7 @@ network_bulk(struct parse_result *res)
> errx(1, "bad prefix: %s", b);
> net.prefix = h;
> net.prefixlen = len;
> + net.rtableid = tableid;
>
> if (res->action == NETWORK_BULK_ADD) {
> imsg_compose(ibuf, IMSG_NETWORK_ADD,
>
>
>