Date: Thu, 1 Aug 2013 16:25:09 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r324114 - in head/net/bird: . files Message-ID: <201308011625.r71GP9BP058800@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@SUFFIX@ +- $(INSTALL_PROGRAM) -s $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl@SUFFIX@ ++ $(INSTALL_PROGRAM) $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX@ ++ $(INSTALL_PROGRAM) $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl@SUFFIX@ + if test -n "@CLIENT@" ; then \ +- $(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX@ ; \ ++ $(INSTALL_PROGRAM) $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@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) */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308011625.r71GP9BP058800>