History log of /netbsd-current/usr.sbin/ldpd/mpls_routes.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.25 07-Apr-2022 andvar

fix various typos in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.24 04-Apr-2016 ozaki-r

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


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.23 12-Oct-2013 kefren

zeroize the rest of the comparable struct before adding it to the rb tree


# 1.22 31-Jul-2013 kefren

Store local bindings in a rbtree


# 1.21 27-Jul-2013 kefren

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


# 1.20 24-Jul-2013 kefren

* 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


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1
# 1.19 20-Jul-2013 kefren

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


# 1.18 18-Jul-2013 kefren

* 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


# 1.17 18-Jul-2013 kefren

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


Revision tags: riastradh-drm2-base
# 1.16 16-Jul-2013 kefren

branches: 1.16.2;
create binding for connected routes on startup
decay an warning message to debug only


# 1.15 16-Jul-2013 kefren

retire union_ntoa, replace it with satos
check for valid sizes on PF_ROUTE socket
minor comment update


# 1.14 12-Jul-2013 kefren

correct loopback address test
correct addr add/del handling


# 1.13 11-Jul-2013 kefren

add code for address and address withdraw messages
get rid of unused fields in tlv struct


# 1.12 11-Jul-2013 kefren

sprinkle more const


# 1.11 11-Jul-2013 kefren

speed up a little bit the string<->prefixlen transforms


Revision tags: agc-symver-base
# 1.10 26-Jan-2013 kefren

modify structures in order to accomodate IPv6 according to
draft-ietf-mpls-ldp-ipv6. Correct a little bit IPv6 hello path


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.9 15-Mar-2012 joerg

branches: 1.9.2;
Add __printflike attribution to use vprintf and friends with an argument
as format string.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 16-Jun-2011 kefren

branches: 1.8.2;
Correct prefixlen->sockaddr calculation. Now ldpd may finally allow MPLS
forwarding for default route.


# 1.7 16-Jun-2011 kefren

shorten some execution paths related to check_route() and get_route()
statify a bit
don't assume AF_INET in a debug message


# 1.6 14-Jun-2011 kefren

* 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


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base
# 1.5 14-Feb-2011 kefren

branches: 1.5.2;
get rid of unused variable/assignments


# 1.4 09-Feb-2011 kefren

use RT_ROUNDUP provided by net/route.h


# 1.3 04-Jan-2011 kefren

branches: 1.3.2;
check from_cidr_to_union() result


Revision tags: matt-mips64-premerge-20101231
# 1.2 09-Dec-2010 christos

- no cast for malloc
- malloc + memset = calloc
- sizeof(type) -> sizeof(*var)
- small indents


# 1.1 08-Dec-2010 kefren

Add ldpd, a RFC 3036 compatible LDP speaker.


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.24 04-Apr-2016 ozaki-r

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


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.23 12-Oct-2013 kefren

zeroize the rest of the comparable struct before adding it to the rb tree


# 1.22 31-Jul-2013 kefren

Store local bindings in a rbtree


# 1.21 27-Jul-2013 kefren

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


# 1.20 24-Jul-2013 kefren

* 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


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1
# 1.19 20-Jul-2013 kefren

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


# 1.18 18-Jul-2013 kefren

* 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


# 1.17 18-Jul-2013 kefren

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


Revision tags: riastradh-drm2-base
# 1.16 16-Jul-2013 kefren

branches: 1.16.2;
create binding for connected routes on startup
decay an warning message to debug only


# 1.15 16-Jul-2013 kefren

retire union_ntoa, replace it with satos
check for valid sizes on PF_ROUTE socket
minor comment update


# 1.14 12-Jul-2013 kefren

correct loopback address test
correct addr add/del handling


# 1.13 11-Jul-2013 kefren

add code for address and address withdraw messages
get rid of unused fields in tlv struct


# 1.12 11-Jul-2013 kefren

sprinkle more const


# 1.11 11-Jul-2013 kefren

speed up a little bit the string<->prefixlen transforms


Revision tags: agc-symver-base
# 1.10 26-Jan-2013 kefren

modify structures in order to accomodate IPv6 according to
draft-ietf-mpls-ldp-ipv6. Correct a little bit IPv6 hello path


Revision tags: yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.9 15-Mar-2012 joerg

branches: 1.9.2;
Add __printflike attribution to use vprintf and friends with an argument
as format string.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 16-Jun-2011 kefren

branches: 1.8.2;
Correct prefixlen->sockaddr calculation. Now ldpd may finally allow MPLS
forwarding for default route.


# 1.7 16-Jun-2011 kefren

shorten some execution paths related to check_route() and get_route()
statify a bit
don't assume AF_INET in a debug message


# 1.6 14-Jun-2011 kefren

* 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


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base
# 1.5 14-Feb-2011 kefren

branches: 1.5.2;
get rid of unused variable/assignments


# 1.4 09-Feb-2011 kefren

use RT_ROUNDUP provided by net/route.h


# 1.3 04-Jan-2011 kefren

branches: 1.3.2;
check from_cidr_to_union() result


Revision tags: matt-mips64-premerge-20101231
# 1.2 09-Dec-2010 christos

- no cast for malloc
- malloc + memset = calloc
- sizeof(type) -> sizeof(*var)
- small indents


# 1.1 08-Dec-2010 kefren

Add ldpd, a RFC 3036 compatible LDP speaker.