-/* $OpenBSD: rde.c,v 1.389 2018/07/10 12:38:50 benno Exp $ */
+/* $OpenBSD: rde.c,v 1.390 2018/07/10 15:13:35 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
NULL, 0);
goto done;
}
- if (prefixlen > 32) {
- log_peer_warnx(&peer->conf, "bad withdraw prefix");
- rde_update_err(peer, ERR_UPDATE, ERR_UPD_NETWORK,
- NULL, 0);
- goto done;
- }
-
p += pos;
len -= pos;
mpa.unreach, mpa.unreach_len);
goto done;
}
- if (prefixlen > 128) {
- log_peer_warnx(&peer->conf,
- "bad IPv6 withdraw prefix");
- rde_update_err(peer, ERR_UPDATE,
- ERR_UPD_OPTATTR,
- mpa.unreach, mpa.unreach_len);
- goto done;
- }
-
mpp += pos;
mplen -= pos;
mpa.unreach, mpa.unreach_len);
goto done;
}
- if (prefixlen > 32) {
- log_peer_warnx(&peer->conf,
- "bad VPNv4 withdraw prefix");
- rde_update_err(peer, ERR_UPDATE,
- ERR_UPD_OPTATTR,
- mpa.unreach, mpa.unreach_len);
- goto done;
- }
-
mpp += pos;
mplen -= pos;
NULL, 0);
goto done;
}
- if (prefixlen > 32) {
- log_peer_warnx(&peer->conf, "bad nlri prefix");
- rde_update_err(peer, ERR_UPDATE, ERR_UPD_NETWORK,
- NULL, 0);
- goto done;
- }
-
p += pos;
nlri_len -= pos;
mpa.reach, mpa.reach_len);
goto done;
}
- if (prefixlen > 128) {
- rde_update_err(peer, ERR_UPDATE,
- ERR_UPD_OPTATTR,
- mpa.reach, mpa.reach_len);
- goto done;
- }
-
mpp += pos;
mplen -= pos;
mpa.reach, mpa.reach_len);
goto done;
}
- if (prefixlen > 32) {
- rde_update_err(peer, ERR_UPDATE,
- ERR_UPD_OPTATTR,
- mpa.reach, mpa.reach_len);
- goto done;
- }
-
mpp += pos;
mplen -= pos;
prefix->aid = AID_INET;
*prefixlen = pfxlen;
+ if (pfxlen > 32)
+ return (-1);
if ((plen = rde_update_extract_prefix(p, len, &prefix->v4, pfxlen,
sizeof(prefix->v4))) == -1)
return (-1);
prefix->aid = AID_INET6;
*prefixlen = pfxlen;
+ if (pfxlen > 128)
+ return (-1);
if ((plen = rde_update_extract_prefix(p, len, &prefix->v6, pfxlen,
sizeof(prefix->v6))) == -1)
return (-1);
prefix->aid = AID_VPN_IPv4;
*prefixlen = pfxlen;
+ if (pfxlen > 32)
+ return (-1);
if ((rv = rde_update_extract_prefix(p, len, &prefix->vpn4.addr,
pfxlen, sizeof(prefix->vpn4.addr))) == -1)
return (-1);