svn commit: r324114 - in head/net/bird: . files

Alexander V. Chernikov melifaro at FreeBSD.org
Thu Aug 1 16:25:10 UTC 2013


Author: melifaro (src committer)
Date: Thu Aug  1 16:25:09 2013
New Revision: 324114
URL: http://svnweb.freebsd.org/changeset/ports/324114

Log:
  Do proper primary IP selection.
  Do not strip binaries explicitly.
  Bump revision.
  
  Approved by:	vsevolod

Added:
  head/net/bird/files/patch-Makefile.in   (contents, props changed)
  head/net/bird/files/patch-bird_addr_select   (contents, props changed)
Modified:
  head/net/bird/Makefile

Modified: head/net/bird/Makefile
==============================================================================
--- head/net/bird/Makefile	Thu Aug  1 15:43:22 2013	(r324113)
+++ head/net/bird/Makefile	Thu Aug  1 16:25:09 2013	(r324114)
@@ -3,6 +3,7 @@
 
 PORTNAME=	bird
 PORTVERSION=	1.3.11
+PORTREVESION=	1
 CATEGORIES=	net
 MASTER_SITES=	ftp://bird.network.cz/pub/bird/ \
 		http://bird.mpls.in/distfiles/bird/

Added: head/net/bird/files/patch-Makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/bird/files/patch-Makefile.in	Thu Aug  1 16:25:09 2013	(r324114)
@@ -0,0 +1,16 @@
+--- tools/Makefile.in.orig	2013-08-01 20:04:09.338432694 +0400
++++ tools/Makefile.in	2013-08-01 20:04:29.477297340 +0400
+@@ -69,10 +69,10 @@
+ 
+ install: all
+ 	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
+-	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird at SUFFIX@
+-	$(INSTALL_PROGRAM) -s $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl at SUFFIX@
++	$(INSTALL_PROGRAM) $(exedir)/bird $(DESTDIR)/$(sbindir)/bird at SUFFIX@
++	$(INSTALL_PROGRAM) $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl at SUFFIX@
+ 	if test -n "@CLIENT@" ; then								\
+-		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc at SUFFIX@ ;	\
++		$(INSTALL_PROGRAM) $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc at SUFFIX@ ;	\
+ 	fi
+ 	if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then						\
+ 		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ;	\

Added: head/net/bird/files/patch-bird_addr_select
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/bird/files/patch-bird_addr_select	Thu Aug  1 16:25:09 2013	(r324114)
@@ -0,0 +1,77 @@
+diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
+index e970d6b..202255e 100644
+--- sysdep/bsd/krt-sock.c
++++ sysdep/bsd/krt-sock.c
+@@ -594,6 +594,45 @@ krt_read_addr(struct ks_msg *msg)
+     ifa_delete(&ifa);
+ }
+ 
++#ifndef IPV6
++struct ifa *
++kif_get_primary_ip(struct iface *i)
++{
++  struct ifreq ifr;
++  int fd, res;
++  struct sockaddr_in *sin;
++  ip_addr addr = IPA_NONE;
++  struct ifa *a = NULL;
++
++  fd = socket(AF_INET, SOCK_DGRAM, 0);
++
++  if (fd == -1)
++    return NULL;
++
++  memset(&ifr, 0, sizeof(ifr));
++
++  strcpy(ifr.ifr_name, i->name);
++
++  res = ioctl(fd, SIOCGIFADDR, (char *)&ifr);
++  close(fd);
++
++  if (res == -1)
++    return NULL;
++
++  sin = (struct sockaddr_in *)&ifr.ifr_addr;
++  memcpy(&addr, &sin->sin_addr, sizeof(ip_addr));
++  ipa_ntoh(addr);
++
++  WALK_LIST(a, i->addrs)
++    {
++      if (a->ip == addr)
++	return a;
++    }
++
++  return NULL;
++}
++#endif
++
+ 
+ void
+ krt_read_msg(struct proto *p, struct ks_msg *msg, int scan)
+diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
+index 3761ace..1fc4345 100644
+--- sysdep/unix/krt.c
++++ sysdep/unix/krt.c
+@@ -157,6 +157,9 @@ kif_choose_primary(struct iface *i)
+ 	  return a;
+     }
+ 
++  if (a = kif_get_primary_ip(i))
++    return a;
++
+   return find_preferred_ifa(i, IPA_NONE, IPA_NONE);
+ }
+ 
+diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
+index d6fbf72..3a037e3 100644
+--- sysdep/unix/krt.h
++++ sysdep/unix/krt.h
+@@ -78,6 +78,8 @@ void kif_request_scan(void);
+ void krt_got_route(struct krt_proto *p, struct rte *e);
+ void krt_got_route_async(struct krt_proto *p, struct rte *e, int new);
+ 
++struct ifa *kif_get_primary_ip(struct iface *i);
++
+ /* Values for rte->u.krt_sync.src */
+ #define KRT_SRC_UNKNOWN	-1	/* Nobody knows */
+ #define KRT_SRC_BIRD	 0	/* Our route (not passed in async mode) */


More information about the svn-ports-head mailing list