Revision b6c9d8eb sysdep/linux/netlink/netlink.c

View differences:

sysdep/linux/netlink/netlink.c
768 768
  x = recvmsg(sk->fd, &m, 0);
769 769
  if (x < 0)
770 770
    {
771
      if (errno != EWOULDBLOCK)
771
      if (errno == ENOBUFS)
772
	{
773
	  /*
774
	   *  Netlink reports some packets have been thrown away.
775
	   *  One day we might react to it by asking for route table
776
	   *  scan in near future.
777
	   */
778
	  return 1;	/* More data are likely to be ready */
779
	}
780
      else if (errno != EWOULDBLOCK)
772 781
	log(L_ERR "Netlink recvmsg: %m");
773 782
      return 0;
774 783
    }
......
800 809
  sock *sk;
801 810
  struct sockaddr_nl sa;
802 811
  int fd;
812
  static int nl_open_tried = 0;
813

  
814
  if (nl_open_tried)
815
    return;
816
  nl_open_tried = 1;
803 817

  
804 818
  DBG("KRT: Opening async netlink socket\n");
805 819

  
......
859 873
void
860 874
krt_scan_construct(struct krt_config *x)
861 875
{
862
  x->scan.async = 1;
863 876
#ifndef IPV6
864 877
  x->scan.table_id = RT_TABLE_MAIN;
865 878
#endif
866
  /* FIXME: Use larger defaults for scanning times? */
867 879
}
868 880

  
869 881
void
......
874 886
  if (first)
875 887
    {
876 888
      nl_open();
877
      if (KRT_CF->scan.async)	/* FIXME: Async is for debugging only. Get rid of it some day. */
878
	nl_open_async();
889
      nl_open_async();
879 890
    }
880 891
}
881 892

  
......
888 899
krt_if_start(struct kif_proto *p)
889 900
{
890 901
  nl_open();
891
  /* FIXME: nl_open_async() after scan.async is gone */
902
  nl_open_async();
892 903
}

Also available in: Unified diff