diff options
Diffstat (limited to 'net/openbgpd/files/patch-bgpd_config.c')
-rw-r--r-- | net/openbgpd/files/patch-bgpd_config.c | 83 |
1 files changed, 77 insertions, 6 deletions
diff --git a/net/openbgpd/files/patch-bgpd_config.c b/net/openbgpd/files/patch-bgpd_config.c index 77598e255fa6..3df03c1b3795 100644 --- a/net/openbgpd/files/patch-bgpd_config.c +++ b/net/openbgpd/files/patch-bgpd_config.c @@ -2,17 +2,57 @@ Index: bgpd/config.c =================================================================== RCS file: /home/cvs/private/hrs/openbgpd/bgpd/config.c,v retrieving revision 1.1.1.6 -retrieving revision 1.1.1.7 -diff -u -p -r1.1.1.6 -r1.1.1.7 +retrieving revision 1.2 +diff -u -p -r1.1.1.6 -r1.2 --- bgpd/config.c 14 Feb 2010 20:19:57 -0000 1.1.1.6 -+++ bgpd/config.c 14 Feb 2010 20:27:06 -0000 1.1.1.7 ++++ bgpd/config.c 2 Jul 2011 16:06:38 -0000 1.2 @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.51 2009/01/26 23:10:02 claudio Exp $ */ -+/* $OpenBSD: config.c,v 1.52 2009/12/01 14:28:05 claudio Exp $ */ ++/* $OpenBSD: config.c,v 1.56 2010/10/24 17:20:08 deraadt Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> -@@ -208,7 +208,7 @@ host_v4(const char *s, struct bgpd_addr +@@ -20,6 +20,11 @@ + #include <sys/socket.h> + #include <sys/stat.h> + #include <sys/mman.h> ++#include <sys/ioctl.h> ++ ++#if !defined(__FreeBSD__) /* FreeBSD has no mpls support. */ ++#include <netmpls/mpls.h> ++#endif + + #include <errno.h> + #include <ifaddrs.h> +@@ -47,8 +52,6 @@ merge_config(struct bgpd_config *xconf, + + /* preserve cmd line opts */ + conf->opts = xconf->opts; +- conf->csock = xconf->csock; +- conf->rcsock = xconf->rcsock; + + if (!conf->as) { + log_warnx("configuration error: AS not given"); +@@ -64,6 +67,9 @@ merge_config(struct bgpd_config *xconf, + if ((conf->flags & BGPD_FLAG_REFLECTOR) && conf->clusterid == 0) + conf->clusterid = conf->bgpid; + ++ free(xconf->csock); ++ free(xconf->rcsock); ++ + conf->listen_addrs = xconf->listen_addrs; + memcpy(xconf, conf, sizeof(struct bgpd_config)); + +@@ -74,7 +80,7 @@ merge_config(struct bgpd_config *xconf, + nla->reconf = RECONF_REINIT; + + } else { +- /* ++ /* + * merge new listeners: + * -flag all existing ones as to be deleted + * -those that are in both new and old: flag to keep +@@ -208,7 +214,7 @@ host_v4(const char *s, struct bgpd_addr return (0); } @@ -21,7 +61,7 @@ diff -u -p -r1.1.1.6 -r1.1.1.7 h->v4.s_addr = ina.s_addr; *len = bits; -@@ -225,13 +225,7 @@ host_v6(const char *s, struct bgpd_addr +@@ -225,13 +231,7 @@ host_v6(const char *s, struct bgpd_addr hints.ai_socktype = SOCK_DGRAM; /*dummy*/ hints.ai_flags = AI_NUMERICHOST; if (getaddrinfo(s, "0", &hints, &res) == 0) { @@ -36,3 +76,34 @@ diff -u -p -r1.1.1.6 -r1.1.1.7 freeaddrinfo(res); return (1); } +@@ -317,3 +317,30 @@ prepare_listeners(struct bgpd_config *co + } + } + } ++ ++int ++get_mpe_label(struct rdomain *r) ++{ ++#if !defined(__FreeBSD__) /* FreeBSD has no mpls support. */ ++ struct ifreq ifr; ++ struct shim_hdr shim; ++ int s; ++ ++ s = socket(AF_INET, SOCK_DGRAM, 0); ++ if (s == -1) ++ return (-1); ++ ++ bzero(&shim, sizeof(shim)); ++ bzero(&ifr, sizeof(ifr)); ++ strlcpy(ifr.ifr_name, r->ifmpe, sizeof(ifr.ifr_name)); ++ ifr.ifr_data = (caddr_t)&shim; ++ ++ if (ioctl(s, SIOCGETLABEL, (caddr_t)&ifr) == -1) { ++ close(s); ++ return (-1); ++ } ++ close(s); ++ r->label = shim.shim_label; ++#endif ++ return (0); ++} |