summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
AgeCommit message (Collapse)Author
2004-06-20implement file descriptor passing in the imsg/msgbuf framework, and useHenning Brauer
it to let the main process to prepare new listening sockets (socket() and bind()) on behalf of the session engine, which of course cannot bind() to ports < 1024 any more once it dropped privileges. with some help from theo, claudio ok
2004-06-09move to a dynamically allocated struct pollfd array.Henning Brauer
we used a ststic one with OPEN_MAX entries, which is a rather arbitary limit as OPEN_MAX is _not_ the max # of open fds we can have, but just a default for that setting. in the same move we have to allocate the peer_l array, basically there for pfd-index to peer pointers to prevent peer list scans all time, dynamiccaly to. we overallocate a little and use that reserve until we have to realloc again later to prevent reallocs for every single control connection or a single flapping peer. help & ok claudio
2004-06-06rework bgpd's handling of listening sockets. instead of one for eachHenning Brauer
supported address familiy, keep a tailq of an arbitary number of them. the new struct listen_addr contains the sockaddr and the fd. this fixes quite some nasty behaviour which was a consequence of the previous model. looks right deraadt@, and discussed with claudio
2004-05-28detect absence of PF_KEY interface and/or the TCP_MD5SIG setsockoptsHenning Brauer
at runtime and disable said subsystems if so. helps the guys porting bgpd to $otherBSD, and is actually the right thing to do. claudio ok
2004-05-28don't want SO_REUSEPORT...Henning Brauer
2004-05-21Add support for dynamic announcements. Usefule to annouce temporaryClaudio Jeker
blackhole routes or to make network announcements dependent on a external state (e.g. for carp setups) OK henning@
2004-05-08remove unused argument to control_dispatch_msg(), lintHenning Brauer
2004-05-06oups, spacesHenning Brauer
2004-05-06the Address Family Identifier field in the capability announcement isHenning Brauer
2 octets, thus we need to transform it from/to network byte order... fixes capability announcement and -parsing
2004-05-06do not punish the peer (by holding him in IDLE for IdleHoldTime seconds) whenHenning Brauer
receiving a "unsupported capabilities" notification. Speeds capability negotiation up quite a bit with peers that like to whine about caoabilities they don't understand
2004-05-06improve logging in teh capabilities parserHenning Brauer
2004-05-06scale socket buffer sizes (and thus window size) up to up to 64k,Henning Brauer
but only of tcp md5sig or ipsec is in use. excellent idea by ryan some time ago, claudio and theo agree
2004-05-06there's a little race condition: a session is taken down and its associatedHenning Brauer
write buffers are cleared, but there could be imsgs from the RDE for that peer (e. g. UPDATEs) in the read buffers for the pipe to the RDE or buffered in the RDE or somesuch. Thus, in session_update(), explicitely check for the session state and just drop the message if the session is not in state ESTABLISHED. claudio ok
2004-04-29sock -> fd; ok henningTheo de Raadt
2004-04-28rename sock to fdTheo de Raadt
2004-04-28if a peer follows the extremely misgiuded path that the RFCs just barely allowHenning Brauer
to send a NOTIFICATION and thus ternminating the session when it sees a capability it doesn't support (who would guess: zebra does so), parse the data section of the notifcication to find out what what capabilties it didn't like and do not advertise them the next time the session gets up. In case we get a notification about unsupported capabilities with an empty data part (don't ask for RFCs... and guess who does that), disable capabilty announcement alltogether. claudio ok
2004-04-28prefix the auth related defines by AUTH_, we had a name clash, markus okHenning Brauer
2004-04-27rename the ipsec struct to auth, move all tcpmd5 related fields in there, andHenning Brauer
add a generic "method" field that expresses what method (none/md5sig/ipsec manual/ipsec ike) is in use markus ok
2004-04-27unbreak^2Henning Brauer
2004-04-27repairHenning Brauer
2004-04-27crud stripping; henning okTheo de Raadt
2004-04-27announce route refresh capability, and parse announced route refresh capaHenning Brauer
2004-04-27initial route refresh support per RFC2918Henning Brauer
process incoming route refresh request and notify the RDE not advertised via capabilities yet, claudio ok
2004-04-26load ipsec SAs into the kernel and enable them.Markus Friedl
2004-04-26announce multiprotocol capabilities - IPv4 multicast for nowHenning Brauer
this implies ourgoing capabilities annoucnement is there and just needs the values to be filled in for other shitz we'll support soonish
2004-04-25better error logging in parse_capabilities()Henning Brauer
2004-04-25sizeof(op_len) when dealing with op_len, not sizeof(op_type) - same sizeHenning Brauer
so noop
2004-04-25if remote-as was not configured, inherit the AS from the neighbors openHenning Brauer
message for cloned neighbors, claudio ok
2004-04-25reserve upper half of the (internal) ID space for cloned neighbors, claudio okHenning Brauer
2004-04-25do not kill cloned neighbors on reload, claudio okHenning Brauer
2004-04-25add "neighbor cloning", allowing you to specify a prefix and prefixlengthHenning Brauer
instead of the neighbor's IP address. WHen a connection comes in matching that mask we clone the neighbor spec. IPv6 match code by itojun, rde feeding by claudio, ok claudio
2004-04-24make failure in setting up the listeners non-fatal. should make bgpd workHenning Brauer
on inet only kernels again, claudio ok
2004-04-24some rather boring windows talk at cansecwest made me hack initial supportHenning Brauer
for IPv6 transport parts based on a diff from Brent Graveland ok itojun@ claudio@
2004-04-16let getpeerbyip work for both v4 and v6Henning Brauer
2004-04-16make log_conn_attempt work in an address family independent matterHenning Brauer
2004-04-13parse the BGP Multiprotocol Extensions (RFC 2858) capabilities and store inHenning Brauer
the peer struct, claudio ok
2004-03-20comment spelling fixes; ok henning@David Krause
2004-03-18when we are in state CONNECT, i. e. we have a half-open tcp connectionHenning Brauer
to the peer, and we get a connection from exactly that peer, we used to refuse it (because we already had a - tho only half-open - connection). this diff changes that so that the connection request from the neighbor is preferred in only that specific case, and the existing half-open connection is teared down. this can speed up session re-establishment quite a bit, especially with multihop. claudio ok
2004-03-16delay creating the control socket until after forking, but before chrootHenning Brauer
(lives in /var/run, i. e. outside chroot) and privdrop. claudio ok
2004-03-15properly check chdir success after chroot() and tweak err msgs a little,Henning Brauer
claudio ok
2004-03-12not debugging any moreHenning Brauer
2004-03-11Free unneeded mrt lists in SE and on exit. OK henning@Claudio Jeker
2004-03-10pass a pointer to the network list as well to session_main so we can free()Henning Brauer
the members after fork
2004-03-10while walking the peer list on shutdown free the peer structsHenning Brauer
2004-03-10pass a pointer to the filter rule list to session_main() so we can free()Henning Brauer
the list entries and the head there after forking
2004-03-10when we exit try to write out what is left in the msg buffers for the imsgHenning Brauer
pipes and clear buffers afterwards
2004-03-10remove unused functionHenning Brauer
2004-03-10implement framework to announce capabilities in the open messages we send.Henning Brauer
this includes handling "unsupported optional parameter" notifications from the peer and retrying without capability announcement. claudio ok
2004-03-05huch, remove a debug messageHenning Brauer
2004-03-05add a parser for the capability announcements using the OPEN message as perHenning Brauer
RFC 3392. we don't support any capability yet but this at least avoids one session teardown and reestablishment when talking to peers which do support capability announcement (as in: basically any) and we'll start supporting some soon.