summaryrefslogtreecommitdiff
path: root/pbrd/pbr_nht.c
diff options
context:
space:
mode:
authorMartin Winter <mwinter@opensourcerouting.org>2018-05-16 08:36:21 -0700
committerGitHub <noreply@github.com>2018-05-16 08:36:21 -0700
commitc7e35331e3f73d2c7620427f928aa85aa80978ab (patch)
tree27c9f5d867bba7fa7da828a3490bd47e5e369ae9 /pbrd/pbr_nht.c
parent5d5f37c40065eaf9c949582674c1728b93b57bab (diff)
parent430892165e3a0ebc054f83222b6671e4169a1ab1 (diff)
Merge pull request #2240 from donaldsharp/ubuntu_bull
Ubuntu 18.04 fixes
Diffstat (limited to 'pbrd/pbr_nht.c')
-rw-r--r--pbrd/pbr_nht.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index 5be96e86d0..a4a9233f72 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -470,18 +470,6 @@ void pbr_nht_change_group(const char *name)
pbr_nht_install_nexthop_group(pnhgc, nhgc->nhg);
}
-/*
- * Since we are writing into the name field which is PBR_MAP_NAMELEN
- * size, we are expecting this to field to be at max 100 bytes.
- * Newer compilers understand that the %s portion may be up to
- * 100 bytes( because of the size of the string. The %u portion
- * is expected to be 10 bytes. So in `theory` there are situations
- * where we might truncate. The reality this is never going to
- * happen( who is going to create a nexthop group name that is
- * over say 30 characters? ). As such we are expecting the
- * calling function to subtract 10 from the size_t l before
- * we pass it in to get around this new gcc fun.
- */
char *pbr_nht_nexthop_make_name(char *name, size_t l,
uint32_t seqno, char *buffer)
{
@@ -497,7 +485,7 @@ void pbr_nht_add_individual_nexthop(struct pbr_map_sequence *pbrms)
struct pbr_nexthop_cache lookup;
memset(&find, 0, sizeof(find));
- pbr_nht_nexthop_make_name(pbrms->parent->name, PBR_MAP_NAMELEN - 10,
+ pbr_nht_nexthop_make_name(pbrms->parent->name, PBR_NHC_NAMELEN,
pbrms->seqno, find.name);
if (!pbrms->internal_nhg_name)
pbrms->internal_nhg_name = XSTRDUP(MTYPE_TMP, find.name);