From 865b852cbf82f2da6cd3908e76176ceb6ad33d26 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 5 Jan 2005 08:30:35 +0000 Subject: 2005-01-05 Paul Jakma * zserv.c: (zebra_accept) Comment out setting of socket to NONBLOCK for now, as we dont actually deal with with resending.... See bugzilla #122, fix from wawa@yandex-team.ru (Vladimir Ivanov). * kernel_socket.c: (routing_socket) ditto. --- zebra/ChangeLog | 7 +++++++ zebra/kernel_socket.c | 9 +++++++-- zebra/zserv.c | 8 ++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'zebra') diff --git a/zebra/ChangeLog b/zebra/ChangeLog index e26204c8..d54d8a9b 100644 --- a/zebra/ChangeLog +++ b/zebra/ChangeLog @@ -1,3 +1,10 @@ +2005-01-05 Paul Jakma + + * zserv.c: (zebra_accept) Comment out setting of socket to NONBLOCK + for now, as we dont actually deal with with resending.... See + bugzilla #122, fix from wawa@yandex-team.ru (Vladimir Ivanov). + * kernel_socket.c: (routing_socket) ditto. + 2005-01-04 Andrew J. Schorr * rtadv.c: (rtadv_recv_packet,rtadv_send_packet) Use ZCMSG_FIRSTHDR diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 9027cd6a..e6e74449 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -966,8 +966,13 @@ routing_socket () return; } - if (fcntl (routing_sock, F_SETFL, O_NONBLOCK) < 0) - zlog_warn ("Can't set O_NONBLOCK to routing socket"); + /* XXX: Socket should be NONBLOCK, however as we currently + * discard failed writes, this will lead to inconsistencies. + * For now, socket must be blocking. + */ + /*if (fcntl (routing_sock, F_SETFL, O_NONBLOCK) < 0) + zlog_warn ("Can't set O_NONBLOCK to routing socket");*/ + if ( zserv_privs.change (ZPRIVS_LOWER) ) zlog_err ("routing_socket: Can't lower privileges"); diff --git a/zebra/zserv.c b/zebra/zserv.c index 47eb49a4..10616b41 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -1374,10 +1374,14 @@ zebra_accept (struct thread *thread) } /* Make client socket non-blocking. */ - + /* XXX: We dont requeue failed writes, so this leads to inconsistencies. + * for now socket must remain blocking, regardless of risk of deadlocks. + */ + /* val = fcntl (client_sock, F_GETFL, 0); fcntl (client_sock, F_SETFL, (val | O_NONBLOCK)); - + */ + /* Create new zebra client. */ zebra_client_create (client_sock); -- cgit v1.2.1