diff options
author | Ondrej Filip <feela@network.cz> | 2004-06-01 12:55:10 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2004-06-01 12:55:10 +0200 |
commit | 77772dbc6555dfb9aa76c812bcd1792ab503cbe1 (patch) | |
tree | 8a07ef102a80b829c4adab1e8ff5cbc6ca18fa79 | |
parent | a8bb459a3f8769501726ef25e696ea127014383f (diff) | |
download | bird-77772dbc6555dfb9aa76c812bcd1792ab503cbe1.tar bird-77772dbc6555dfb9aa76c812bcd1792ab503cbe1.zip |
Caching loopback interface.
-rw-r--r-- | sysdep/bsd/krt-sock.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index 3b8c50f..4a77bec 100644 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@ -107,6 +107,7 @@ krt_sock_send(int cmd, rte *e, char *name) struct ks_msg msg; char *body = (char *)msg.buf; sockaddr gate, mask, dst; + static struct iface *loop = NULL; DBG("krt-sock: send %I/%d via %I", net->n.prefix, net->n.pxlen, a->gw); @@ -145,16 +146,20 @@ krt_sock_send(int cmd, rte *e, char *name) */ if(!i) { - i = HEAD(iface_list); - - WALK_LIST(j, iface_list) + if(!loop) { - if (j->flags & IF_LOOPBACK) + i = HEAD(iface_list); + + WALK_LIST(j, iface_list) { - i = j; - break; + if (j->flags & IF_LOOPBACK) + { + i = j; + break; + } } } + i = loop; } switch (a->dest) |