summaryrefslogtreecommitdiff
path: root/sysdep/bsd
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2004-06-01 10:45:28 +0000
committerOndrej Filip <feela@network.cz>2004-06-01 10:45:28 +0000
commit1554cc02826794007c113bc336ed574bb771343f (patch)
tree69331f27f7a3c1a1153aca7fb3d694649a0e3c71 /sysdep/bsd
parentb613b9928bdb1df3bd541d318d7f9c1bf492dfbc (diff)
Minor changes caused by MJ's comment.
Diffstat (limited to 'sysdep/bsd')
-rw-r--r--sysdep/bsd/krt-sock.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index ca830523..68f2bb72 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -183,16 +183,12 @@ krt_sock_send(int cmd, rte *e, char *name)
fill_in_sockaddr(&gate, i->addr->ip, 0);
msg.rtm.rtm_addrs |= RTA_GATEWAY;
}
- else
- {
- bug("krt-sock: interface route %I/%d without interface", net->n.prefix, net->n.pxlen);
- }
break;
default:
bug("krt-sock: unknown flags, but not filtered");
}
- if(i) msg.rtm.rtm_index = i->index;
+ msg.rtm.rtm_index = i->index;
NEXTADDR(RTA_DST, dst);
NEXTADDR(RTA_GATEWAY, gate);
@@ -244,18 +240,20 @@ krt_set_start(struct krt_proto *x, int first)
sk_rt->fd = rt_sock;
sk_rt->data = x;
if (sk_open(sk_rt))
- bug("Krt_sock: sk_rt_open failed");
+ bug("Krt_sock: sk_open failed");
}
static int
krt_set_hook(sock *sk, int size)
{
- int l;
struct ks_msg msg;
-
- l = read(sk->fd, (char *)&msg, sizeof(msg));
+ int l = read(sk->fd, (char *)&msg, sizeof(msg));
+ if(l <= 0)
+ log(L_WARN "Krt-sock: read failed");
+ else
krt_read_msg((struct proto *)sk->data, &msg, 0);
+
return 0;
}
@@ -565,7 +563,7 @@ krt_read_msg(struct proto *p, struct ks_msg *msg, int scan)
}
-struct iface *
+static struct iface *
krt_temp_iface(struct krt_proto *p, char *name)
{
struct iface *i;