Commit Graph

24 Commits

Author SHA1 Message Date
ozaki-r
09973b35ac Separate nexthop caches from the routing table
By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html
2016-04-04 07:37:07 +00:00
kefren
ee8be8cbb6 zeroize the rest of the comparable struct before adding it to the rb tree 2013-10-12 18:55:40 +00:00
kefren
9661871102 Store local bindings in a rbtree 2013-07-31 06:58:23 +00:00
kefren
7eaad7a39f check route messages sizes more carefully
cache pid
treat every message at a time, even if there are more messages to read
interpret also cloning routes

The latter two should fix the ldp_regen test
2013-07-27 14:35:41 +00:00
kefren
0c8e14c9e8 * use a flag in label struct in order to determine if we should treat the
associated routes using RTF_HOST
* clean the mess in flush_mpls_routes that could result in accessing
  uninitialized memory
2013-07-24 09:05:53 +00:00
kefren
ae8b7d0074 don't connect on first hello, there are chances that ours is not seen yet
setproctitle with ldp id - useful for rump kernels testing
fix a memory leak in ldp_peer_new
don't holddown if already holded down
peer sockets are now non-blocking
connected routes deletes are now processed
check if peer is connected before attempting to sending label mappings
2013-07-20 05:16:08 +00:00
kefren
e8941bb5d0 * rework the reattachment code
* build an implnull label when a route is added and let mpls_add_label
  to take care of relabelling
* take out last piece of the code where we do route lookups - we should have
  every information we need in labels
* tested these changes using a number of rump kernels and some couple of
  thousands of flapping routes
2013-07-18 11:45:36 +00:00
kefren
9b2110eba6 Make sure labels are always updated when a route is added and when a peer
is added
Rework mpls_add_label according to that so no route refresh is done anymore
Use poll when reading the PF_ROUTE socket
setsockopt SO_USELOOPBACK on the PF_ROUTE socket
Output some information on SIGINFO
Allow map changing for a ldp peer
Finally fix the connected routes admission into labels
Correct the route trigger when a label map is received
2013-07-18 06:07:45 +00:00
kefren
4a79aafa57 create binding for connected routes on startup
decay an warning message to debug only
2013-07-16 16:55:01 +00:00
kefren
3e54e2f09f retire union_ntoa, replace it with satos
check for valid sizes on PF_ROUTE socket
minor comment update
2013-07-16 02:54:32 +00:00
kefren
0e52e04b03 correct loopback address test
correct addr add/del handling
2013-07-12 08:55:52 +00:00
kefren
949b2852b8 add code for address and address withdraw messages
get rid of unused fields in tlv struct
2013-07-11 18:02:03 +00:00
kefren
046ba50ee2 sprinkle more const 2013-07-11 10:46:19 +00:00
kefren
702fd22f56 speed up a little bit the string<->prefixlen transforms 2013-07-11 09:11:35 +00:00
kefren
269ea2d396 modify structures in order to accomodate IPv6 according to
draft-ietf-mpls-ldp-ipv6. Correct a little bit IPv6 hello path
2013-01-26 17:29:55 +00:00
joerg
66dd2755f5 Add __printflike attribution to use vprintf and friends with an argument
as format string.
2012-03-15 02:02:20 +00:00
kefren
d4ba594c90 Correct prefixlen->sockaddr calculation. Now ldpd may finally allow MPLS
forwarding for default route.
2011-06-16 20:42:15 +00:00
kefren
7102910ef8 shorten some execution paths related to check_route() and get_route()
statify a bit
don't assume AF_INET in a debug message
2011-06-16 07:11:51 +00:00
kefren
9b733c1c9d * add no-default-route option into configuration file and check it before
rejecting default-route
* exit process in case of error into the main loop
* complete FSM for RTM_CHANGE
* Check if we overflow pollfd array
2011-06-14 11:28:51 +00:00
kefren
a9e39e843e get rid of unused variable/assignments 2011-02-14 11:43:59 +00:00
kefren
34493327dd use RT_ROUNDUP provided by net/route.h 2011-02-09 11:38:57 +00:00
kefren
57323b5589 check from_cidr_to_union() result 2011-01-04 10:58:15 +00:00
christos
14db3bb9d8 - no cast for malloc
- malloc + memset = calloc
- sizeof(type) -> sizeof(*var)
- small indents
2010-12-09 00:10:59 +00:00
kefren
e7341ada4c Add ldpd, a RFC 3036 compatible LDP speaker. 2010-12-08 07:20:14 +00:00