From 4a6925edecdcb5c4ee626705cb95ffd74e8551b5 Mon Sep 17 00:00:00 2001 From: claudio Date: Fri, 20 Jul 2018 14:14:43 +0000 Subject: [PATCH] Rename rde_update_extract_prefix to extract_prefix and make it static. This is just an internal of the the rde_update_get_prefix functions. --- usr.sbin/bgpd/rde.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 6969ef902f4..f8cc2c9a26c 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.394 2018/07/16 09:09:20 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.395 2018/07/20 14:14:43 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -61,8 +61,6 @@ int rde_attr_add(struct rde_aspath *, u_char *, u_int16_t); u_int8_t rde_attr_missing(struct rde_aspath *, int, u_int16_t); int rde_get_mp_nexthop(u_char *, u_int16_t, u_int8_t, struct filterstate *); -int rde_update_extract_prefix(u_char *, u_int16_t, void *, - u_int8_t, u_int8_t); int rde_update_get_prefix(u_char *, u_int16_t, struct bgpd_addr *, u_int8_t *); int rde_update_get_prefix6(u_char *, u_int16_t, struct bgpd_addr *, @@ -1841,8 +1839,8 @@ rde_get_mp_nexthop(u_char *data, u_int16_t len, u_int8_t aid, return (totlen); } -int -rde_update_extract_prefix(u_char *p, u_int16_t len, void *va, +static int +extract_prefix(u_char *p, u_int16_t len, void *va, u_int8_t pfxlen, u_int8_t max) { static u_char addrmask[] = { @@ -1886,7 +1884,7 @@ rde_update_get_prefix(u_char *p, u_int16_t len, struct bgpd_addr *prefix, if (pfxlen > 32) return (-1); - if ((plen = rde_update_extract_prefix(p, len, &prefix->v4, pfxlen, + if ((plen = extract_prefix(p, len, &prefix->v4, pfxlen, sizeof(prefix->v4))) == -1) return (-1); @@ -1912,7 +1910,7 @@ rde_update_get_prefix6(u_char *p, u_int16_t len, struct bgpd_addr *prefix, if (pfxlen > 128) return (-1); - if ((plen = rde_update_extract_prefix(p, len, &prefix->v6, pfxlen, + if ((plen = extract_prefix(p, len, &prefix->v6, pfxlen, sizeof(prefix->v6))) == -1) return (-1); @@ -1975,7 +1973,7 @@ rde_update_get_vpn4(u_char *p, u_int16_t len, struct bgpd_addr *prefix, if (pfxlen > 32) return (-1); - if ((rv = rde_update_extract_prefix(p, len, &prefix->vpn4.addr, + if ((rv = extract_prefix(p, len, &prefix->vpn4.addr, pfxlen, sizeof(prefix->vpn4.addr))) == -1) return (-1); -- 2.20.1