summaryrefslogtreecommitdiffstats
path: root/babeld/util.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 16:54:10 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 16:54:10 +0200
commit45833edae0fe12c87cdb90f939c07d282959e1b9 (patch)
tree42eb6c90cc2e78c30d56f2b173b2f944517e5bda /babeld/util.c
parent*: Convert numeric 128 into IPV6_MAX_BITLEN for prefixlen (diff)
downloadfrr-45833edae0fe12c87cdb90f939c07d282959e1b9.tar.xz
frr-45833edae0fe12c87cdb90f939c07d282959e1b9.zip
babeld: Drop in_prefix() function
Not used. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'babeld/util.c')
-rw-r--r--babeld/util.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/babeld/util.c b/babeld/util.c
index e99bd861d..be838fa43 100644
--- a/babeld/util.c
+++ b/babeld/util.c
@@ -216,26 +216,6 @@ parse_nat(const char *string)
return (int)l;
}
-int
-in_prefix(const unsigned char *restrict address,
- const unsigned char *restrict prefix, unsigned char plen)
-{
- unsigned char m;
-
- if(plen > 128)
- plen = 128;
-
- if(memcmp(address, prefix, plen / 8) != 0)
- return 0;
-
- if(plen % 8 == 0)
- return 1;
-
- m = 0xFF << (8 - (plen % 8));
-
- return ((address[plen / 8] & m) == (prefix[plen / 8] & m));
-}
-
unsigned char *
mask_prefix(unsigned char *restrict ret,
const unsigned char *restrict prefix, unsigned char plen)