[prev in list] [next in list] [prev in thread] [next in thread]
List: openbsd-tech
Subject: Re: bgpd, kill net/route.h dependency in bgpd.h
From: Theo Buehler <tb () theobuehler ! org>
Date: 2022-09-23 12:56:35
Message-ID: Yy2tA6P/jVcZGoyD () theobuehler ! org
[Download RAW message or body]
On Fri, Sep 23, 2022 at 12:10:45PM +0200, Claudio Jeker wrote:
> Linux is driving me nuts. The mix of net/, netinet/ includes and the need
> to also include some linux/ headers like linux/if.h and linux/in6.h result
> in absolute madness. Try to trim the includes in bgpd.h by defining our
> own label size for route labels.
>
> With this the net/route.h compat shim can die. Won't probably help my real
> issue but one thing less to juggle.
>
> Naming is pain, I went with ROUTELABEL_LEN other option is BGPDLABEL_LEN
> or maybe someone else has a good idea
Name seems fine to me, I don't have a better suggestion
ok
> --
> :wq Claudio
>
> Index: bgpd.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/bgpd.h,v
> retrieving revision 1.453
> diff -u -p -r1.453 bgpd.h
> --- bgpd.h 21 Sep 2022 21:12:03 -0000 1.453
> +++ bgpd.h 23 Sep 2022 09:51:23 -0000
> @@ -22,7 +22,6 @@
> #include <sys/socket.h>
> #include <sys/queue.h>
> #include <sys/tree.h>
> -#include <net/route.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
> #include <net/if.h>
> @@ -41,6 +40,7 @@
> #define PEER_DESCR_LEN 32
> #define REASON_LEN 256 /* includes NUL terminator */
> #define PFTABLE_LEN 32
> +#define ROUTELABEL_LEN 32
> #define TCP_MD5_KEY_LEN 80
> #define IPSEC_ENC_KEY_LEN 32
> #define IPSEC_AUTH_KEY_LEN 20
> @@ -705,7 +705,7 @@ struct ktable {
> struct kroute_full {
> struct bgpd_addr prefix;
> struct bgpd_addr nexthop;
> - char label[RTLABEL_LEN];
> + char label[ROUTELABEL_LEN];
> uint32_t mplslabel;
> uint16_t flags;
> u_short ifindex;
> @@ -1117,7 +1117,7 @@ struct filter_set {
> struct nexthop *nh_ref;
> struct community community;
> char pftable[PFTABLE_LEN];
> - char rtlabel[RTLABEL_LEN];
> + char rtlabel[ROUTELABEL_LEN];
> uint8_t origin;
> } action;
> enum action_types type;
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic