diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index ddc66d9e273..7c352c6a616 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.83 2004/02/07 00:16:14 henning Exp $ */ +/* $OpenBSD: kroute.c,v 1.84 2004/02/07 01:28:13 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1155,10 +1155,11 @@ dispatch_rtmsg(void) ((struct sockaddr_in *)sa)->sin_addr.s_addr; sa_in = (struct sockaddr_in *) rti_info[RTAX_NETMASK]; - if (sa_in != NULL) - prefixlen = mask2prefixlen( - sa_in->sin_addr.s_addr); - else if (rtm->rtm_flags & RTF_HOST) + if (sa_in != NULL) { + if (sa_in->sin_len != 0) + prefixlen = mask2prefixlen( + sa_in->sin_addr.s_addr); + } else if (rtm->rtm_flags & RTF_HOST) prefixlen = 32; else prefixlen = |