Skip to content

Commit

Permalink
lib: fix srv6 locator flags propagated to isis
Browse files Browse the repository at this point in the history
When usid is not used, the isis_srv6_topo1 test does not work.
The SID prefix allocated by isis is different when the usid
flags is set or not. When the flags is not transmitted to isis,
the SID allocated is supposed to be a 128 bit mask length SID,
which is not what the isis_srv6_topo1 test is supposed to obtain.

Fix this by exchanging the flags locator value in the zclient api.

Fixes: 9b7491e ("lib: Add support for flags to the SRv6 locator")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Apr 3, 2024
1 parent 27cc9ae commit a4cba21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/zclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ int zapi_srv6_locator_encode(struct stream *s, const struct srv6_locator *l)
stream_put(s, l->name, strlen(l->name));
stream_putw(s, l->prefix.prefixlen);
stream_put(s, &l->prefix.prefix, sizeof(l->prefix.prefix));
stream_putc(s, l->flags);
return 0;
}

Expand All @@ -1140,6 +1141,7 @@ int zapi_srv6_locator_decode(struct stream *s, struct srv6_locator *l)
STREAM_GETW(s, l->prefix.prefixlen);
STREAM_GET(&l->prefix.prefix, s, sizeof(l->prefix.prefix));
l->prefix.family = AF_INET6;
STREAM_GETC(s, l->flags);
return 0;

stream_failure:
Expand Down

0 comments on commit a4cba21

Please sign in to comment.