Re: ospf6ctl.8 - document missing database filters

2018-06-05 Thread Claudio Jeker
On Tue, Jun 05, 2018 at 10:29:48PM +0200, Stefan Sperling wrote: > On Tue, Jun 05, 2018 at 10:24:09PM +0200, Remi Locherer wrote: > > Hi, > > > > the ospf6ctl manual misses two database filters. > > > > OK? > > > > Remi > > ok me too > > > > > > Index: ospf6ctl.8 > >

Re: ospf6d: fix metric for intra area prefix LSAs

2018-06-06 Thread Claudio Jeker
On Wed, Jun 06, 2018 at 08:06:30AM +0200, Remi Locherer wrote: > Hi, > > RfC 5340 says that for intra area prefix LSAs metric should be set to 0 > in case of point-to-multipoint or loopback interfaces. Otherwise metric > should be set to the value of the interfaces output cost. > > ospf6d

Re: bgpd: stop with the announce confusion

2018-06-07 Thread Claudio Jeker
On Wed, Jun 06, 2018 at 11:04:56PM +0200, Claudio Jeker wrote: > So the announce keyword in bgpd is massivly overloaded. > It is one of the most common things new bgpd users are unsure about. > These are all possible announce options: > > announce (IPv4|IPv6) (none|unicast|

Re: bgpd: stop with the announce confusion

2018-06-07 Thread Claudio Jeker
On Thu, Jun 07, 2018 at 10:20:17AM +0100, Stuart Henderson wrote: > On 2018/06/07 10:26, Claudio Jeker wrote: > > On Wed, Jun 06, 2018 at 11:04:56PM +0200, Claudio Jeker wrote: > > > So the announce keyword in bgpd is massivly overloaded. > > > It is one of the most c

Re: ospf6d: fix metric for intra area prefix LSAs

2018-06-06 Thread Claudio Jeker
On Wed, Jun 06, 2018 at 08:17:54PM +0200, Remi Locherer wrote: > On Wed, Jun 06, 2018 at 09:01:49AM +0200, Claudio Jeker wrote: > > On Wed, Jun 06, 2018 at 08:06:30AM +0200, Remi Locherer wrote: > > > Hi, > > > > > > RfC 5340 says that for intra area p

bgpd: stop with the announce confusion

2018-06-06 Thread Claudio Jeker
So the announce keyword in bgpd is massivly overloaded. It is one of the most common things new bgpd users are unsure about. These are all possible announce options: announce (IPv4|IPv6) (none|unicast|vpn) announce as-4byte (yes|no) announce capabilities (yes|no) announce refresh (yes|no)

Re: bgpd: stop with the announce confusion

2018-06-07 Thread Claudio Jeker
On Thu, Jun 07, 2018 at 12:14:07PM +0200, Claudio Jeker wrote: > On Thu, Jun 07, 2018 at 10:20:17AM +0100, Stuart Henderson wrote: > > On 2018/06/07 10:26, Claudio Jeker wrote: > > > On Wed, Jun 06, 2018 at 11:04:56PM +0200, Claudio Jeker wrote: > > > > So the announ

bgpd ignore aspath with to large attributes

2018-05-30 Thread Claudio Jeker
Hi, This adds a protection to handle aspaths overly large attributes in bgpd. The main idea is to protect other bgp routes downstream for hitting the limit with is often not well catched. The limit is currently a bit arbitarily set to 4096 - 1024 which is afaik the same limit that bird uses.

Re: bgpd ignore aspath with to large attributes

2018-05-31 Thread Claudio Jeker
On Thu, May 31, 2018 at 11:12:38AM +, Job Snijders wrote: > On Wed, May 30, 2018 at 03:18:45PM +0200, Claudio Jeker wrote: > > This adds a protection to handle aspaths overly large attributes in > > bgpd. The main idea is to protect other bgp routes downstream for > &

Re: ber.c fix for length calculations

2018-06-25 Thread Claudio Jeker
On Sun, Jun 24, 2018 at 05:58:09PM -0400, Rob Pierce wrote: > It looks like a BER problem found while testing the new ldap client (with an > empty password) was already addressed in snmpd back in 2010 by martinh. > > In LDAP under a CONTEXT class, 0 corresponds to LDAP_AUTH_SIMPLE. This is >

more bgpd cleanup

2018-06-27 Thread Claudio Jeker
My plan is to make struct prefix the main object that holds references to aspath, nexthop and rib. This diff is the next little step towards that. Pass a struct prefix to rde_filter and remove some of the arguments which are now fetched from struct prefix. Currently some trickery is needed for

Re: sync calloc call in ber.c

2018-06-27 Thread Claudio Jeker
On Wed, Jun 27, 2018 at 10:05:52AM -0400, Rob Pierce wrote: > This ber.c change has been in ldapd since rev 1.1 and was applied to snmpd > back > in 2012. The following diff applies the change to the ldap client and ypldap. > > Ok? OK claudio@ > Index: usr.bin/ldap/ber.c >

Re: route(8): stop debugging route monitor

2018-05-01 Thread Claudio Jeker
On Tue, May 01, 2018 at 11:53:16AM +0200, Sebastian Benoit wrote: > Florian Obser(flor...@openbsd.org) on 2018.04.30 18:27:52 +0200: > > The -d flag should be a no-op in monitor mode since it does not modify > > the routing table. > > > > However, if -d is provided route monitor lists all

Re: "max" field in "netstat -m" is ambiguous

2017-10-28 Thread Claudio Jeker
On Sat, Oct 28, 2017 at 11:06:16AM +0200, Mike Belopuhov wrote: > On Thu, Oct 26, 2017 at 08:58 +0200, Claudio Jeker wrote: > > On Wed, Oct 25, 2017 at 11:46:05PM +0200, Mike Belopuhov wrote: > > > On Wed, Oct 25, 2017 at 21:56 +0200, Claudio Jeker wrote: > > > > W

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Claudio Jeker
On Tue, Jul 03, 2018 at 03:45:49PM -0400, Rob Pierce wrote: > On Sat, Jun 30, 2018 at 02:04:16PM -0400, Rob Pierce wrote: > > I recently committed a piece of BER code synchronizing in the wrong > > direction > > (i.e. from the ldap instances to the snmpd instance). sthen@ noticed a break > > in

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Claudio Jeker
On Tue, Jul 03, 2018 at 05:38:18PM -0400, Rob Pierce wrote: > On Tue, Jul 03, 2018 at 09:25:06PM +0100, Stuart Henderson wrote: > > On 2018/07/03 22:17, Claudio Jeker wrote: > > > I have a hard time to understand why this is needed in snmpd. > > > For single cha

bgpd softreconf in optimisation

2018-07-03 Thread Claudio Jeker
There is no need to run against both input filters. path_update() and prefix_remove() are both smart enough to handle all cases (similar to a regular update). Should make reloads a bit faster. More precise - prefix_remove() of a non existing prefix is a NOP - path_update() does itself a

Re: restrict carp use to ethernet interfaces

2018-01-11 Thread Claudio Jeker
On Thu, Jan 11, 2018 at 11:51:25AM +0100, Peter Hessler wrote: > On 2018 Jan 11 (Thu) at 20:41:19 +1000 (+1000), David Gwynne wrote: > :vlan and trunk are definitely ethernet interfaces. > : > > Is there anything in OpenBSD that isn't an ethernet inteface? > How about gif(4), gre(4), tun(4),

Re: make mpls_input take struct ifnet *ifp as an argument

2018-01-08 Thread Claudio Jeker
On Mon, Jan 08, 2018 at 11:50:54AM +0100, Alexander Bluhm wrote: > On Mon, Jan 08, 2018 at 11:49:05AM +1000, David Gwynne wrote: > > i want this so it makes mpls_input have the same function signature > > as all the other protocol input functions we care about. > > > > it also helps mpls_input

Re: Fix for vi(1) manpage Visual command

2018-02-07 Thread Claudio Jeker
On Wed, Feb 07, 2018 at 07:28:42PM +0100, Ingo Schwarze wrote: > Hi, > > while trying to fix the documentation of screen splitting in the vi(1) > manual page, jmc@ suggested to stop documenting it at all. I like > the idea because splitting is useless and confusing and the already > excessively

Re: ifconfig foo0 tunnelttl copy

2018-02-07 Thread Claudio Jeker
On Thu, Feb 08, 2018 at 04:27:57PM +1000, David Gwynne wrote: > some interfaces could support copying the ttl from an inner packet to an > outer one, but there's no obvious way to configure that at the moment. > > this borrows the semantic of using -1 for a special thing from > vnetid. this

Re: ospfd getting confused about who is DR

2018-02-08 Thread Claudio Jeker
On Fri, Feb 09, 2018 at 03:39:43AM +0100, Claudio Jeker wrote: > On netsplits it can happen that on join multiple ospfd end up as DR. > In my case with 3 routers the one cut off stays DR even though the rest of > the network already has a DR and BDR. > > Looking into this it see

ospfd getting confused about who is DR

2018-02-08 Thread Claudio Jeker
On netsplits it can happen that on join multiple ospfd end up as DR. In my case with 3 routers the one cut off stays DR even though the rest of the network already has a DR and BDR. Looking into this it seems that in some cases we don't issue an IF_EVT_NBR_CHNG and so the re-evaluation of DR/BDR

Re: ospfd: depend on interface (new feature)

2018-02-03 Thread Claudio Jeker
On Sun, Feb 04, 2018 at 12:42:22AM +0100, Remi Locherer wrote: > Hi > > This adds a new feature to ospfd: depend on interface. > > A ospfd.conf using it looks like this: > > --%<-- > redistribute default depend on carp0 > area 0.0.0.0 { > interface em2 { depend on carp0 } > [...] >

handle updates via Adj-RIB-Out

2018-02-06 Thread Claudio Jeker
This diff changes the way bgpd does updates. Instead of having its own special update queue/tree it uses a regular RIB (Adj-RIB-Out) to store all updates to be sent. Stuff that has been sent is linked to the prefixes queue. On the peer there are also queues for updates and withdraws. The whole

Re: ospfd (route socket filter on priority)

2018-02-10 Thread Claudio Jeker
On Sun, Feb 11, 2018 at 02:17:38AM +0100, Sebastian Benoit wrote: > > Hi, > > here is the ospfd part again, now the socket option is set on reload as > well. > > ok? > > (benno_route_priofilter_2_ospfd.diff) > > diff --git usr.sbin/ospfd/kroute.c usr.sbin/ospfd/kroute.c > index

Re: allow marking IPv6 with a do not fragment flag for ip6_output

2018-02-10 Thread Claudio Jeker
On Sat, Feb 10, 2018 at 09:03:10PM +1000, David Gwynne wrote: > ipv6 packets dont have a DF bit you can set in the header, you have > to pass it as an option to ip6_output if you want that behaviour > on output. however, ip6_send makes it hard to pass ip6 options to > ip6_output because you give

IPv6 reject routes autocreation

2018-02-10 Thread Claudio Jeker
Similar to IPv4 this will inject all the magic reject routes for IPv6. This includes the bad networks in the 6to4 range (2002::/16) and some other magic. Here it what you get: Internet6: DestinationGateway Flags Refs Use Mtu Prio Iface ::/96

remove lo0 handing from etc/netstart

2018-02-09 Thread Claudio Jeker
Since today lo(4) will create 127.0.0.1 and the 127/8 reject route automatically. This means /etc/netstart no longer needs to do that. I will commit this in a few days so that people can make sure to have -current kernels. -- :wq Claudio Index: etc/netstart

Re: ber.{c,h}: remove direct fd read/writes

2018-02-05 Thread Claudio Jeker
On Mon, Feb 05, 2018 at 06:52:39PM +0100, Jeremie Courreges-Anglas wrote: > > Hi, > > while reviewing an snmpd diff, I noticed that the fd in struct ber was > always set to -1; and indeed snmpd, ldapd and ypldap only pass buffers > to the ber API. So this diff removes support for direct

Re: relayd stops processing traffic intermittently

2017-12-28 Thread Claudio Jeker
Forwarding to tech, since people may have missed this. Hope to commit this soon. - Forwarded message from Claudio Jeker <cje...@diehard.n-r-g.com> - Date: Sun, 24 Dec 2017 19:07:11 +0100 From: Claudio Jeker To: Mischa Peters Subject: Re: relayd stops processing traffic intermit

Re: unifdef snd/rcv

2018-01-03 Thread Claudio Jeker
On Wed, Jan 03, 2018 at 03:46:13PM +0100, Martin Pieuchot wrote: > These defines do not help, they'll make further changes more complicated > to understand, so I'd like to remove them. ok? Yes, this is just being lazy in the wrong place. OK claudio@ > Index: kern/uipc_usrreq.c >

Re: Remove useless includes

2018-01-04 Thread Claudio Jeker
On Thu, Jan 04, 2018 at 03:58:07PM +0100, Martin Pieuchot wrote: > 'struct socket' is exposed to userland via . Most of > our programs in base do not need it. Since I'm going to change the > content of this struct for MP works, I'd like to reduce the impact on > userland. > > Here's a diff to

Re: ypldap: sync aldap from ldap(1)

2018-06-21 Thread Claudio Jeker
On Thu, Jun 21, 2018 at 10:33:37AM +0200, Reyk Floeter wrote: > Hi, > > the _url code was broken and disabled in ypldap's aldap - I fixed it > for ldap(1). The other chunk is a DEBUG message fix, not compiled by > default. > > OK? Looks good to me. OK claudio@ > Index:

BGPD, remove unused fields in RDE

2018-06-21 Thread Claudio Jeker
Nothing is using the per aspath counts in the RDE. Remove them, makes the code simpler. OK? -- :wq Claudio Index: rde.h === RCS file: /cvs/src/usr.sbin/bgpd/rde.h,v retrieving revision 1.168 diff -u -p -r1.168 rde.h --- rde.h

BGPD - refactor nexthop handling

2018-06-21 Thread Claudio Jeker
This is the first step of some larger reshuffling of how the RDE is working. One of the things needed is proper reference counting for nexthops since I want to kill nexthop_link and nexthop_unlink in the long run. Even though an intermediat step the result is IMO a lot cleaner than before.

Re: bgpd: sofreconfig in reshuffle

2018-08-03 Thread Claudio Jeker
On Thu, Aug 02, 2018 at 02:56:59PM +0200, Claudio Jeker wrote: > On Tue, Jul 31, 2018 at 05:39:31PM +0200, Claudio Jeker wrote: > > Instead of walking the Adj-RIB-In per RIB walk it once and check per > > prefix if the RIB needs an update or not. This will make it easier to ma

Re: bgpd: sofreconfig in reshuffle

2018-08-03 Thread Claudio Jeker
On Fri, Aug 03, 2018 at 11:01:39AM +0200, Claudio Jeker wrote: > On Thu, Aug 02, 2018 at 02:56:59PM +0200, Claudio Jeker wrote: > > On Tue, Jul 31, 2018 at 05:39:31PM +0200, Claudio Jeker wrote: > > > Instead of walking the Adj-RIB-In per RIB walk it once and check per >

bgpd: reload RIBs in background

2018-08-03 Thread Claudio Jeker
So the reshuffling made it possible to simply run the reconfigure of the RIBs in the background and no longer lock up the RDE for extended times. In short this means that during 'bgpctl reload' other bgpctl calls no longer block and that also UPDATE from neighbors are fully processed. This does

bgpd, lies bloody lies

2018-07-27 Thread Claudio Jeker
Since the RIBs have been fully split there is no way that an update of a Loc-RIB is modifying the Adj-RIB-In. Because of that there is no need for the comment and also for the more complex loop construct. -- :wq Claudio Index: rde.c

Re: relocate some public ber functions

2018-07-31 Thread Claudio Jeker
On Mon, Jul 30, 2018 at 04:39:39PM -0400, Rob Pierce wrote: > Some public ber functions sneaked in below the internal functions comment. > Move > them up so the comment regains its former truthiness. > > Ok? OK claudio@ > Index: usr.bin/ldap/ber.c >

bgpd: make announced networks more like regular prefixes

2018-07-31 Thread Claudio Jeker
This brings the network code more in line with what regular update processing does. It adds the prefix to Adj-RIB-In and if "log update" is set it will also log the addition and removal of a prefix. To make the output of log update nicer I pimped peerself and also initialize the remote address to

bgpd: refine source-as matching

2018-08-09 Thread Claudio Jeker
Per rfc6472 AS_SET should no longer be used but some AS still do. Until now source-as would take the rightmost AS number of an AS_PATH no matter if it was an AS_SEQUENCE or an AS_SET. Thit is not correct. Also because AS_SET are used in aggregation source-as should match against the aggregator AS

Re: Check lo(4) rdomain before attempting to move it to another

2018-08-06 Thread Claudio Jeker
On Mon, Aug 06, 2018 at 03:37:38PM +0200, Sebastian Benoit wrote: > Ayaka Koshibe(akosh...@openbsd.org) on 2018.08.05 17:43:34 -0700: > > Hi, > > > > I noticed that if you try to move an immovable lo(4) to a nonexistent > > rdomain, > > a new routing table will be created despite the operation

Re: bgpd: reload RIBs in background

2018-08-07 Thread Claudio Jeker
On Fri, Aug 03, 2018 at 04:31:58PM +0200, Claudio Jeker wrote: > So the reshuffling made it possible to simply run the reconfigure > of the RIBs in the background and no longer lock up the RDE for > extended times. In short this means that during 'bgpctl reload' > other bgpctl cal

Re: change ber_write_elements to return ssize_t

2018-08-11 Thread Claudio Jeker
On Sat, Aug 11, 2018 at 09:54:44PM -0400, Rob Pierce wrote: > In aldap.c, tls_write(2) and write(2) also return ssize_t, so both error and > wrote have been changed accordingly. > > ok? OK claudio > Index: usr.bin/ldap/aldap.c >

Re: bgpd: refine source-as matching

2018-08-09 Thread Claudio Jeker
On Thu, Aug 09, 2018 at 10:37:50PM +0200, Sebastian Benoit wrote: > Claudio Jeker(cje...@diehard.n-r-g.com) on 2018.08.09 21:59:16 +0200: > > On Thu, Aug 09, 2018 at 03:10:11PM +0200, Claudio Jeker wrote: > > > Per rfc6472 AS_SET should no longer be used but some AS still d

Re: bgpd: refine source-as matching

2018-08-09 Thread Claudio Jeker
On Thu, Aug 09, 2018 at 03:10:11PM +0200, Claudio Jeker wrote: > Per rfc6472 AS_SET should no longer be used but some AS still do. > Until now source-as would take the rightmost AS number of an AS_PATH no > matter if it was an AS_SEQUENCE or an AS_SET. Thit is not correct. Also > be

Re: ospfd: prevent additional ospfd from starting

2018-08-24 Thread Claudio Jeker
On Wed, Aug 22, 2018 at 12:12:10AM +0200, Remi Locherer wrote: > On Tue, Aug 21, 2018 at 05:54:18PM +0100, Stuart Henderson wrote: > > On 2018/08/21 17:16, Remi Locherer wrote: > > > Hi tech, > > > > > > recently we had a short outage in our network. A script started an > > > additional > > >

Re: fix assignment in if-clause in upgt(4)

2018-08-24 Thread Claudio Jeker
On Fri, Aug 24, 2018 at 11:57:54AM +0100, Ricardo Mestre wrote: > Hi, > > Similar to the patch I just sent for smsc(4) this one also has a misplaced > parenthesis in an if-clause. NetBSD fixed this on rev 1.13. > > OK? OK claudio > Index: if_upgt.c >

Re: ospfd: prevent additional ospfd from starting

2018-08-28 Thread Claudio Jeker
On Tue, Aug 28, 2018 at 01:19:39PM +0200, Remi Locherer wrote: > On Tue, Aug 28, 2018 at 07:56:43AM +0200, Claudio Jeker wrote: > > On Mon, Aug 27, 2018 at 11:33:19PM +0200, Remi Locherer wrote: > > > On Fri, Aug 24, 2018 at 12:21:31PM +0200, Remi Locherer wrote: > > > &

bgpd, log updates and invalid path

2018-08-29 Thread Claudio Jeker
Currently if a path is rejected because of parse errors there is only a generic error message logged but it is not clear which prefix caused it. Lets make this at least more obvious when 'log updates' is used. OK? -- :wq Claudio Index: rde.c

bgpd, streamline aspath matching

2018-08-27 Thread Claudio Jeker
This is in preparation for introducing as-sets (a fast lookup table for when you want to make sure that your peering partner is realy only passing you traffic he should). To make as-set possible lets do some cleanup beforehands. This mainly removes one element from the filter_as struct, uses

Re: bgpd, streamline aspath matching

2018-08-27 Thread Claudio Jeker
On Mon, Aug 27, 2018 at 12:11:43PM +0200, Claudio Jeker wrote: > This is in preparation for introducing as-sets (a fast lookup table for > when you want to make sure that your peering partner is realy only passing > you traffic he should). > > To make as-set possible lets

Re: ospfd: prevent additional ospfd from starting

2018-08-27 Thread Claudio Jeker
On Mon, Aug 27, 2018 at 11:33:19PM +0200, Remi Locherer wrote: > On Fri, Aug 24, 2018 at 12:21:31PM +0200, Remi Locherer wrote: > > On Fri, Aug 24, 2018 at 08:58:12AM +0200, Claudio Jeker wrote: > > > On Wed, Aug 22, 2018 at 12:12:10AM +0200, Remi Locherer wrote: > > > &

Re: bgpd: allow dumping of invalid paths via control socket

2018-08-29 Thread Claudio Jeker
On Wed, Aug 29, 2018 at 01:07:33PM +0200, Claudio Jeker wrote: > This is the bgpd diff that allows bgpctl to show invalid / error paths > which act as an implicit withdraw. > > While there also fix 'bgpctl show rib in nei foo' since until now that > code actually printed the same

bgpd: allow dumping of invalid paths via control socket

2018-08-29 Thread Claudio Jeker
This is the bgpd diff that allows bgpctl to show invalid / error paths which act as an implicit withdraw. While there also fix 'bgpctl show rib in nei foo' since until now that code actually printed the same as 'bgpctl show rib nei foo'. The code is a bit shuffled to make the if statement in

bgpctl show mrt without bgpd running

2018-07-17 Thread Claudio Jeker
There is no reason why bgpd must be running to do a bgpctl show mrt call. This diff moves the SHOW_MRT case up to the IRRFILTER one and also makes the pledge() calls stricter. I see no reason why rpath or wpath are needed and neither did benno@ remember why. OK? -- :wq Claudio Index: bgpctl.c

teach bgpctl show mrt to handle timestamps

2018-07-17 Thread Claudio Jeker
This diffs adds timestamps similar to kdump to bgpctl show mrt output when messages or states are shown. Currently it looks like this: 1531425344.00 153.5.146.105[23456] -> 62.48.0.253[0]: size 63 0.00 153.5.146.105[23456] -> 62.48.0.253[0]: Connect -> OpenSent 0.00

bgpd switch mrt format to extended timestamp

2018-07-16 Thread Claudio Jeker
For "dump (all|updates) (in|out)" it totally makes sense to use the extended timestamp format that includes microseconds as well. This way it is better visible when updates got processed. Table dumps are not affected since there the timestamp is not that useful. bgpdump shows now the time with

Re: cleanup defunct prototype in snmpe.c

2018-07-23 Thread Claudio Jeker
On Mon, Jul 23, 2018 at 04:17:07PM -0400, Rob Pierce wrote: > It looks like some code was shuffled around in revision 1.34 in which > snmpe_application was renamed to smi_application and this prototype was > missed. > > ok? OK claudio@ > Index: snmpe.c >

bgpd, use prefix_nexthop to access nexthop

2018-07-24 Thread Claudio Jeker
This diff simply changes all the nexthop accesses from asp->nexthop to calling prefix_nexthop() which currently does the same. This will ease moving the nexthop into struct prefix and is part of a larger diff that does exactly that. OK? -- :wq Claudio Index: mrt.c

full 'bgpctl show mrt' support

2018-07-21 Thread Claudio Jeker
This adds the missing parser for messages aka updates. It is reusing some of bgpd's functions which I already moved to util.c for that and reimplements a few other bits. It also extends the current attribute printing code to support all attributes even those that are not seen in the ususal show

bgpd minor cleanup

2018-07-21 Thread Claudio Jeker
Fix a printf and change the way data is increased so that at the end of the function it is not overflowing. In the VPN4 case data is increased by sizeof(u_int64_t) but later on the data is increased by the full length which moves the pointer beyond the end. Now this is not really a problem since

bgpd move nexthop into filterstate

2018-07-18 Thread Claudio Jeker
This is the next small bit of rde rebuilding. Move nexthop into struct filterstate (including nexthop flags) and use them whereever possible. In some places (path_update, softreconfig_out handler) the nexthop state are folded back into the rde_aspath. This also fixes a possible crash when it

Re: xidle: launching program on timeout without active-area

2018-07-25 Thread Claudio Jeker
On Wed, Jul 25, 2018 at 12:27:29PM +0200, Sebastien Marie wrote: > On Mon, Jul 16, 2018 at 11:37:41AM +0200, Sebastien Marie wrote: > > Hi, > > > > I am looking at a way to auto-logout some workstation on inactivity. > > ping. > > no problem if there is no interest for such thing in xidle, I

Re: ospfd: document in which cases the route prio filter is not used

2018-07-25 Thread Claudio Jeker
On Tue, Jul 24, 2018 at 05:46:15PM +0100, Jason McIntyre wrote: > On Tue, Jul 24, 2018 at 04:18:38PM +0200, Sebastian Benoit wrote: > > phessler@ noticed that we dont document which redistribute settings > > cause the priority filter to be enabled/disabled. > > > > Add this text: > > > >

Re: bgpd, move nexthop pointer to struct prefix

2018-07-25 Thread Claudio Jeker
On Tue, Jul 24, 2018 at 01:00:03PM +0200, Claudio Jeker wrote: > After a lot of preparation diffs this does the actuall change of moving > the nexthop form struct rde_aspath to struct prefix. Also the nexthop > flags are moved into their own flag variable (reducing the flag masking > t

bgpd, move nexthop pointer to struct prefix

2018-07-24 Thread Claudio Jeker
After a lot of preparation diffs this does the actuall change of moving the nexthop form struct rde_aspath to struct prefix. Also the nexthop flags are moved into their own flag variable (reducing the flag masking that happened before). I tested this with most nexthop combos I can think of and

Re: bgpd, allow for bigger (prefixlist) macros

2018-09-04 Thread Claudio Jeker
On Tue, Sep 04, 2018 at 08:15:23PM +0200, Denis Fondras wrote: > Hi, > > While generating big prefixlists macros with bgpq3 (big like > as2914:as-europe-v6 > for example), OpenBGPd cannot load the config file (error "string too long"). > This diff implements a dynamic buffer to overcome this

bgpd - simplify prefixlen logic

2018-09-04 Thread Claudio Jeker
Currently a lot of different operations are implemented for prefix matching. This is not really needed because most can be expressed with the range expression (prefixlen A - B). The only exceptions are the != and >< operators. Both of them are a bit excotic and may be removed at a later time.

Re: pfctl: remove wildcard address on loopback remnants

2018-09-07 Thread Claudio Jeker
On Fri, Sep 07, 2018 at 12:23:05PM +0200, Klemens Nanni wrote: > henning@ removed this functionality years ago, see the lo.4 diff: > > revision 1.27 > date: 2011/04/02 14:38:09; author: henning; state: Exp; lines: +2 > -37; > rmeove the link1 hack, it is in the way, it is

Re: switchd(8): don't set output port to OFP*_PORT_ANY for input == output

2018-09-09 Thread Claudio Jeker
On Sun, Sep 09, 2018 at 03:17:19AM -0700, Ayaka Koshibe wrote: > Hi, > > This is a new version of a previous diff that I had for making switchd(8) > ignore PACKET_IN messages generated from looped traffic. Currently, it will > respond to the PACKET_IN with an invalid PACKET_OUT onto

Re: if_cloners list is poulated at system boot only

2018-09-09 Thread Claudio Jeker
On Sun, Sep 09, 2018 at 08:41:07AM +0200, Alexandr Nedvedicky wrote: > Hello, > > while poking around 'XXXSMP' comments in net/if.c, I've noticed > the 'if_cloners_lock' can be removed. The thing is the list of > cloners gets populated/modified at system boot only, while kernel > attaches device

Re: bgpd, streamline aspath matching

2018-09-04 Thread Claudio Jeker
On Tue, Sep 04, 2018 at 05:49:29PM +0200, Denis Fondras wrote: > On Tue, Sep 04, 2018 at 01:56:12PM +0200, Claudio Jeker wrote: > > On Mon, Aug 27, 2018 at 12:11:43PM +0200, Claudio Jeker wrote: > > > This is in preparation for introducing as-sets (a fast lookup table for &

bgpd, fast as number lookups using as-set

2018-09-06 Thread Claudio Jeker
t.ps != NULL) && @@ -615,6 +621,13 @@ rde_filter_equal(struct filter_head *a, & PREFIXSET_FLAG_DIRTY) != 0)) { log_debug("%s: prefixset %s has changed", __func__, fa->match.prefixset.name); +

bgpd make prefix-set fast

2018-09-07 Thread Claudio Jeker
.ps->dirty) { log_debug("%s: prefixset %s has changed", __func__, fa->match.prefixset.name); return (0); Index: rde_trie.c === RCS file: rde_trie.

Re: bgpd, streamline aspath matching

2018-09-04 Thread Claudio Jeker
On Mon, Aug 27, 2018 at 12:11:43PM +0200, Claudio Jeker wrote: > This is in preparation for introducing as-sets (a fast lookup table for > when you want to make sure that your peering partner is realy only passing > you traffic he should). > > To make as-set possible lets

bgpd diff

2018-09-04 Thread Claudio Jeker
Yet another minor bgpd diff from a much bigger diff. This adds inet4applymask() similar to inet6applymask() and starts using it in a few places. This makes some of the INET vs INET6 cases more similar. OK? -- :wq Claudio Index: bgpd.h

Re: xidle: launching program on timeout without active-area

2018-09-04 Thread Claudio Jeker
wrote: > > > On Wed, Jul 25, 2018 at 12:55:48PM +0200, Claudio Jeker wrote: > > > > On Wed, Jul 25, 2018 at 12:27:29PM +0200, Sebastien Marie wrote: > > > > > On Mon, Jul 16, 2018 at 11:37:41AM +0200, Sebastien Marie wrote: > > > > >

Re: remove pcb hash macros

2018-09-11 Thread Claudio Jeker
On Tue, Sep 11, 2018 at 12:01:28AM +0200, Alexander Bluhm wrote: > Hi, > > I don't see any use for the INPCBHASH() macros. Just expand them. > > ok? OK claudio@ > bluhm > > Index: netinet/in_pcb.c > === > RCS file:

Re: priofilter and rtm message types

2018-07-05 Thread Claudio Jeker
On Wed, Jul 04, 2018 at 11:51:46PM +0200, Sebastian Benoit wrote: > Remi noticed that ospfd does no longer see new interfaces. > > The priority filter should only work on routing messages that > have a rtm_priority. > > So these are out: > > RTM_DELADDR > RTM_NEWADDR (struct ifa_msghdr) >

bgpd introduce filterstate

2018-07-05 Thread Claudio Jeker
Next step on the bigger RIB refactor. Introduce a filterstate instead of passing multiple things around. As a benefit this reduces the amount of malloc() / free() calls because the rde_aspath is now on the stack. After that more changes will become possible like moving nexthop into the state, etc.

Re: slaacd, can we use AF_INET6 to restrict route messages?

2018-07-05 Thread Claudio Jeker
On Thu, Jul 05, 2018 at 10:51:24PM +0100, Stuart Henderson wrote: > I noticed relatively high cpu use from slaacd on a BGP router > that was undergoing some route churn earlier (no interfaces were > actually configured to use slaac). > > routesock is currently unfiltered so will see a lot of

Re: slaacd, can we use AF_INET6 to restrict route messages?

2018-07-06 Thread Claudio Jeker
t;); > > - if ((frontend_routesock = socket(PF_ROUTE, SOCK_RAW | SOCK_CLOEXEC, 0)) > - < 0) > + if ((frontend_routesock = socket(PF_ROUTE, SOCK_RAW | SOCK_CLOEXEC, > + AF_INET6)) < 0) > fatal("route socket"); > > rtfilter = ROUTE_

Re: ospf6d: Do not try to change cloning routes into gateway routes

2018-07-10 Thread Claudio Jeker
On Tue, Jul 10, 2018 at 01:56:37PM +0200, Florian Riehm wrote: > Hi, > > If intra area prefixes move from one router to another router, cloning routes > may become gateway routes and contrary. The kernel does not allow to change > the > flags RTF_GATEWAY / RTF_CLONING in RTM_CHANGE messages, but

Re: ospfd: track gateway addresses of cloning routes

2018-07-10 Thread Claudio Jeker
On Tue, Jul 10, 2018 at 12:18:15PM +0200, Florian Riehm wrote: > Hi, > > since we use multiple cloning routes (mpath) if more than one ip address > exists in the same network, the routes are distinguished by their gateway > address, which is the associated interface address. > The ospfd has to

Re: bgpd parse.y: dont let rtable number overflow

2018-07-10 Thread Claudio Jeker
On Tue, Jul 10, 2018 at 11:15:51AM +0200, Sebastian Benoit wrote: > we only support up to RT_TABLEID_MAX rtables. > > ok? OK > (benno_bgpd_rtable_max.diff) > > Index: parse.y > === > RCS file: /cvs/src/usr.sbin/bgpd/parse.y,v >

Re: bgpd: replacing the rib is needed when the flag changes

2018-07-09 Thread Claudio Jeker
On Tue, Jul 10, 2018 at 12:07:04AM +0200, Sebastian Benoit wrote: > Sebastian Benoit(be...@openbsd.org) on 2018.07.10 00:06:06 +0200: > > Claudio Jeker(cje...@diehard.n-r-g.com) on 2018.07.10 00:05:08 +0200: > > > On Mon, Jul 09, 2018 at 11:58:05PM +0200, Seba

Re: bgpd: free the right thing in rib_free

2018-07-09 Thread Claudio Jeker
On Mon, Jul 09, 2018 at 11:45:41PM +0200, Sebastian Benoit wrote: > Actually free the right thing in rib_free() > Found by and with claudio. > > (benno_claudio_rde_rib_rib_free.diff) OK claudio@ > Index: rde_rib.c > === > RCS

Re: bgpd: replacing the rib is needed when the flag changes

2018-07-09 Thread Claudio Jeker
On Mon, Jul 09, 2018 at 11:58:05PM +0200, Sebastian Benoit wrote: > > compare the right things here: we want to know if the flag has changed. > Found with claudios help and patience. > > ok? This is fucked up. :) > (benno_claudio_rde_reconf_F_RIB_HASNOFIB.diff) > > Index: rde.c >

yet another bgpd cleanup diff

2018-07-10 Thread Claudio Jeker
Again lots of minuses that can be replaced with very few plus lines. This moves the prefixlen check into rde_update_get_prefix*() functions since those can already return an error that is actually the same. OK? -- :wq Claudio Index: rde.c

bgpd use struct filterstate in more places

2018-07-10 Thread Claudio Jeker
This uses struct filterstate in rde_update_dispatch() and passes the struct to a few functions down (rde_update_update, path_update and some more friends). After that it should become easier to move nexthop and later maybe the peer out of struct rde_aspath into struct prefix. -- :wq Claudio

Re: bgpd: announce prefixes with priority n

2018-07-11 Thread Claudio Jeker
On Wed, Jul 11, 2018 at 12:43:41AM +0200, Sebastian Benoit wrote: > hi, > > allows you to announce prefixes from the kernel routing table selected by > priority. > > lightly tested, as in, the config part works. > > network inet priority 32 > > ok? This is fairly esotheric as a feature. It

Re: Time to retire RTM_LOSING

2018-07-11 Thread Claudio Jeker
On Wed, Jul 11, 2018 at 10:10:50AM +0200, Martin Pieuchot wrote: > On 11/07/18(Wed) 09:55, Claudio Jeker wrote: > > On busy servers I seen multiple RTM_LOSING message per second being > > generated. This is not helpful (especially since nothing is doing > > something with i

Time to retire RTM_LOSING

2018-07-11 Thread Claudio Jeker
On busy servers I seen multiple RTM_LOSING message per second being generated. This is not helpful (especially since nothing is doing something with it). This diff removes the part where RTM_LOSING is generated but at the same time adds some RTM_ADD / RTM_DELETE messages for the dynamic routes

bgpd: better hash functions

2018-07-11 Thread Claudio Jeker
Especially the rde_aspath hash function is horrible. Fix this by adding more bits to the SipHash which results in a better spread. Also switch the stored hases to 64bit and save the one for rde_aspath as well since it the compare a lot quicker. -- :wq Claudio Index: rde.h

Re: bgpd: check if we are running in an rtable or a rdomain

2018-07-11 Thread Claudio Jeker
On Wed, Jul 11, 2018 at 10:18:59PM +0200, Sebastian Benoit wrote: > > ok? OK claudio@ > (benno_check_rdomain.diff) > > diff --git usr.sbin/bgpd/config.c usr.sbin/bgpd/config.c > index 2a2e5dfa314..4f8134e6b68 100644 > --- usr.sbin/bgpd/config.c > +++ usr.sbin/bgpd/config.c > @@ -46,6 +46,7 @@

bgpctl show mrt file

2018-07-12 Thread Claudio Jeker
This diff ads enough extra code to parse and display mrt update messages. Some code in bgpd needs to be moved to be reachable by bgpctl. bgpctl code gets reshuffled so that mrt printing works without a running bgpd and also to make the pledge more strict. This is nice to see stuff like the full

Re: ospf6d: remove unneded log_setverbose()

2018-07-09 Thread Claudio Jeker
On Mon, Jul 09, 2018 at 11:33:05AM +0200, Remi Locherer wrote: > On Mon, Jul 09, 2018 at 10:42:16AM +0200, Claudio Jeker wrote: > > On Mon, Jul 09, 2018 at 10:31:15AM +0200, Remi Locherer wrote: > > > later on it is set with: > > > log_setverbose(ospfd_con

<    1   2   3   4   5   6   7   8   9   10   >