Commit 5af7b596 authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka
Browse files

Merge branch 'int-new' of gitlab.labs.nic.cz:labs/bird into int-new

parents d39d41fb b66a9e2f
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
Version 1.6.0 (2016-04-29)
  o Major RIP protocol redesign
  o New Babel routing protocol
  o BGP multipath support
  o KRT: Add support for plenty of kernel route metrics
  o KRT: Allow more than 256 routing tables
  o Static: Allow to specify attributes for static routes
  o Static: Support for BFD controlled static routes
  o FreeBSD: Setup password for BGP MD5 authentication
  o IO: Remove socket number limit
  o Plenty of bug fixes

  Upgrade notes:

  For RIP, most protocol options were moved to interface blocks.


Version 1.5.0 (2015-04-20)
  o Major OSPF protocol redesign.
  o OSPFv2 multi-instance extension (RFC 6549).
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ input_init(void)

  // readline library does strange things when stdin is nonblocking.
  // if (fcntl(0, F_SETFL, O_NONBLOCK) < 0)
  //   die("fcntl: %m");
  //   DIE("fcntl");
}

static void
+4 −3
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
#include <errno.h>

#include <sys/ioctl.h>
#include <signal.h>
@@ -109,7 +110,7 @@ more_begin(void)
  tty.c_lflag &= (~ICANON);

  if (tcsetattr (0, TCSANOW, &tty) < 0)
    die("tcsetattr: %m");
    DIE("tcsetattr");

  more_active = 1;
}
@@ -120,7 +121,7 @@ more_end(void)
  more_active = 0;

  if (tcsetattr (0, TCSANOW, &stored_tty) < 0)
    die("tcsetattr: %m");
    DIE("tcsetattr");
}

static void
@@ -137,7 +138,7 @@ input_init(void)
    return;

  if (tcgetattr(0, &stored_tty) < 0)
    die("tcgetattr: %m");
    DIE("tcgetattr");

  if (signal(SIGINT, sig_handler) == SIG_IGN)
    signal(SIGINT, SIG_IGN);
+16 −23
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@

#define SERVER_READ_BUF_LEN 4096

static char *opt_list = "s:vr";
static char *opt_list = "s:vrl";
static int verbose, restricted, once;
static char *init_cmd;

@@ -59,13 +59,14 @@ int term_lns, term_cls;
static void
usage(char *name)
{
  fprintf(stderr, "Usage: %s [-s <control-socket>] [-v] [-r]\n", name);
  fprintf(stderr, "Usage: %s [-s <control-socket>] [-v] [-r] [-l]\n", name);
  exit(1);
}

static void
parse_args(int argc, char **argv)
{
  int server_changed = 0;
  int c;

  while ((c = getopt(argc, argv, opt_list)) >= 0)
@@ -73,6 +74,7 @@ parse_args(int argc, char **argv)
      {
      case 's':
	server_path = optarg;
	server_changed = 1;
	break;
      case 'v':
	verbose++;
@@ -80,6 +82,10 @@ parse_args(int argc, char **argv)
      case 'r':
	restricted = 1;
	break;
      case 'l':
	if (!server_changed)
	  server_path = xbasename(server_path);
	break;
      default:
	usage(argv[0]);
      }
@@ -242,7 +248,7 @@ server_connect(void)

  server_fd = socket(AF_UNIX, SOCK_STREAM, 0);
  if (server_fd < 0)
    die("Cannot create socket: %m");
    DIE("Cannot create socket");

  if (strlen(server_path) >= sizeof(sa.sun_path))
    die("server_connect: path too long");
@@ -251,9 +257,9 @@ server_connect(void)
  sa.sun_family = AF_UNIX;
  strcpy(sa.sun_path, server_path);
  if (connect(server_fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) < 0)
    die("Unable to connect to server control socket (%s): %m", server_path);
    DIE("Unable to connect to server control socket (%s)", server_path);
  if (fcntl(server_fd, F_SETFL, O_NONBLOCK) < 0)
    die("fcntl: %m");
    DIE("fcntl");
}


@@ -303,13 +309,13 @@ server_read(void)
 redo:
  c = read(server_fd, server_read_pos, server_read_buf + sizeof(server_read_buf) - server_read_pos);
  if (!c)
    die("Connection closed by server.");
    die("Connection closed by server");
  if (c < 0)
    {
      if (errno == EINTR)
	goto redo;
      else
	die("Server read error: %m");
	DIE("Server read error");
    }

  start = server_read_buf;
@@ -360,7 +366,7 @@ select_loop(void)
	  if (errno == EINTR)
	    continue;
	  else
	    die("select: %m");
	    DIE("select");
	}

      if (FD_ISSET(0, &select_fds))
@@ -393,7 +399,7 @@ wait_for_write(int fd)
	  if (errno == EINTR)
	    continue;
	  else
	    die("select: %m");
	    DIE("select");
	}

      if (FD_ISSET(server_fd, &set))
@@ -420,7 +426,7 @@ server_send(char *cmd)
	  else if (errno == EINTR)
	    continue;
	  else
	    die("Server write error: %m");
	    DIE("Server write error");
	}
      else
	{
@@ -430,19 +436,6 @@ server_send(char *cmd)
    }
}


/* XXXX

      get_term_size();

      if (tcgetattr(0, &tty_save) != 0)
        {
          perror("tcgetattr error");
          return(EXIT_FAILURE);
        }
    }

 */
int
main(int argc, char **argv)
{
+3 −0
Original line number Diff line number Diff line
@@ -34,3 +34,6 @@ char *cmd_expand(char *cmd);
/* client.c */

void submit_command(char *cmd_raw);

/* die() with system error messages */
#define DIE(x, y...) die(x ": %s", ##y, strerror(errno))
Loading