diff options
author | melifaro <melifaro@FreeBSD.org> | 2013-08-02 00:25:09 +0800 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2013-08-02 00:25:09 +0800 |
commit | 66281157e5caebcec7661aa6245502bcd271b165 (patch) | |
tree | f4947c9f8724276a187ad7260918327c3f889e37 /net | |
parent | de19b3af0493374041004e0e350986baa195b241 (diff) | |
download | freebsd-ports-gnome-66281157e5caebcec7661aa6245502bcd271b165.tar.gz freebsd-ports-gnome-66281157e5caebcec7661aa6245502bcd271b165.tar.zst freebsd-ports-gnome-66281157e5caebcec7661aa6245502bcd271b165.zip |
Do proper primary IP selection.
Do not strip binaries explicitly.
Bump revision.
Approved by: vsevolod
Diffstat (limited to 'net')
-rw-r--r-- | net/bird/Makefile | 1 | ||||
-rw-r--r-- | net/bird/files/patch-Makefile.in | 16 | ||||
-rw-r--r-- | net/bird/files/patch-bird_addr_select | 77 |
3 files changed, 94 insertions, 0 deletions
diff --git a/net/bird/Makefile b/net/bird/Makefile index 56b2e536258e..31dff7f99869 100644 --- a/net/bird/Makefile +++ b/net/bird/Makefile @@ -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/ diff --git a/net/bird/files/patch-Makefile.in b/net/bird/files/patch-Makefile.in new file mode 100644 index 000000000000..25310282571e --- /dev/null +++ b/net/bird/files/patch-Makefile.in @@ -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@ ; \ diff --git a/net/bird/files/patch-bird_addr_select b/net/bird/files/patch-bird_addr_select new file mode 100644 index 000000000000..67e066a11f5a --- /dev/null +++ b/net/bird/files/patch-bird_addr_select @@ -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) */ |