summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-23 16:07:38 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-23 16:07:38 +0000
commitc5753294e869c2ae302d31c19d945d39d09b2a15 (patch)
tree287405c722971c3ec7a03c4cdf1f1751801e2c21 /usr.sbin
parent65786a071b6f926546c1b07376f6d628891b1bbc (diff)
don't panic on EEXIST. that's normal for a full-table router to get a route
for its own connected network(s)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/kroute.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index 3718dd66083..74cb085bf46 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.2 2003/12/23 15:50:12 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.3 2003/12/23 16:07:37 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -83,7 +83,8 @@ kroute_msg(int fd, int action, struct kroute *kroute)
retry:
if ((n = write(fd, &r, sizeof(r))) == -1) {
- if (errno == ESRCH) {
+ switch (errno) {
+ case ESRCH:
if (r.hdr.rtm_type == RTM_CHANGE) {
r.hdr.rtm_type = RTM_ADD;
goto retry;
@@ -91,7 +92,10 @@ retry:
logit(LOG_INFO, "route vanished before delete");
return (0);
}
- } else {
+ break;
+ case EEXIST: /* connected route. ignore */
+ return (0);
+ default:
logit(LOG_INFO, "kroute_msg: %s", strerror(errno));
return (-1);
}