OpenBSD CVS

CVS log for src/usr.sbin/ripd/kroute.c


[BACK] Up to [local] / src / usr.sbin / ripd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.36 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:14 2023 UTC (15 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.35: +1 -2 lines
Diff to previous 1.35 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.35 / (download) - annotate - [select for diffs], Fri May 6 15:51:09 2022 UTC (2 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.34: +3 -4 lines
Diff to previous 1.34 (colored)

Relax the limitation of what is an acceptable unicast IP.

Remove the IN_BADCLASS() check which filters out the experimental IPv4
address space. Now there are no more experiments in IPv4 and so there
is less reason for these network daemons to deny such an IP.
Everything still disallows multicast IPs (224/4) and loopback (127/8)
a few also disallow 0/8 but this is not consistent.

In any case using 240/4 in production is a really bad idea but it is
not up to this software to prevent you from being a fool.

OK deraadt@ tb@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Dec 11 21:04:59 2019 UTC (4 years, 5 months ago) by remi
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.33: +2 -3 lines
Diff to previous 1.33 (colored)

Fix 2 memory leaks in error paths and a double-free (kroute_insert already
frees kr if it detects a duplicate).

From Hiltjo Posthuma
OK benno@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Dec 31 20:34:16 2018 UTC (5 years, 5 months ago) by remi
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.32: +12 -10 lines
Diff to previous 1.32 (colored)

Add config option fib-priority to set a custom prio for routes ripd
insers into the kernel routing table.

OK deraadt@

Revision 1.32 / (download) - annotate - [select for diffs], Mon Jul 24 11:00:01 2017 UTC (6 years, 10 months ago) by friehm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.31: +4 -4 lines
Diff to previous 1.31 (colored)

Unify ROUNDUP macros for parsing route messages.
Use the macro from route(8) / ospf6d(8) since it works also with argument 0.

OK claudio@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Sep 27 17:32:36 2015 UTC (8 years, 8 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

As done for bgpd recently, rename if_mediatype to if_type in ripd.
And some ifmedia64 fixes.
"move forward" deraadt@

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jul 17 20:38:33 2015 UTC (8 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.29: +14 -3 lines
Diff to previous 1.29 (colored)

Like bgpd and ospfd filter routes by RTF_LLINFO and RTF_BROADCAST and use
the RTF_CONNECTED to know if a route is connected or not.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Feb 11 05:58:08 2015 UTC (9 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

Use sizeof(u_short) in the first check since there are RT messages that
are less then sizeof(*rtm) bytes long (e.g. interface announcements).
Found the hard way by phessler@

Revision 1.28 / (download) - annotate - [select for diffs], Tue Feb 10 08:23:13 2015 UTC (9 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.27: +6 -1 lines
Diff to previous 1.27 (colored)

Sync kroute code with what we do in ospfd/bgpd (EAGAIN handling).

Revision 1.27 / (download) - annotate - [select for diffs], Mon Feb 9 12:34:07 2015 UTC (9 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

Add SOCK_CLOEXEC | SOCK_NONBLOCK to two more socket calls.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:20 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +1 -2 lines
Diff to previous 1.25 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jun 23 03:46:17 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

The second level of the CTL_NET sysctl is a PF_*, not an AF_*

inconsistent usage in route(8) noted by Gregor Best (gbe (at) ring0.de)

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 4 04:34:14 2011 UTC (12 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.23: +3 -7 lines
Diff to previous 1.23 (colored)

LINK_STATE_IS_UP() cleanup userland part. There is no need to special
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does
the right job.
OK deraadt@ henning@

This needs a -current kernel or link state may be not reported correctly.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jun 26 19:19:23 2011 UTC (12 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.22: +1 -17 lines
Diff to previous 1.22 (colored)

Remove obsolete mcast routes in ldpd and ripd.
OK dlg@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jul 12 14:35:13 2010 UTC (13 years, 11 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.21: +6 -17 lines
Diff to previous 1.21 (colored)

Merge duplicate log messages into one log_warn().
ok claudio@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jan 2 14:40:54 2010 UTC (14 years, 5 months ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Fix comparison between the routing message's priority and RTP_RIP.

ok claudio@

Revision 1.20 / (download) - annotate - [select for diffs], Sat Sep 26 18:24:58 2009 UTC (14 years, 8 months ago) by michele
Branch: MAIN
Changes since 1.19: +7 -4 lines
Diff to previous 1.19 (colored)

Preliminary rdomain support.

ok claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Sep 24 12:30:36 2009 UTC (14 years, 8 months ago) by michele
Branch: MAIN
Changes since 1.18: +1 -4 lines
Diff to previous 1.18 (colored)

Priorities are now handled in the kernel so:

- RTF_PROTO3 is useless
- MPLS routes don't need special treatment anymore, so don't track them at all

ok claudio@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Sep 18 16:17:02 2009 UTC (14 years, 8 months ago) by michele
Branch: MAIN
Changes since 1.17: +75 -76 lines
Diff to previous 1.17 (colored)

Make kroute code routing priority aware.

ok claudio@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jul 7 12:07:23 2009 UTC (14 years, 11 months ago) by michele
Branch: MAIN
Changes since 1.16: +4 -2 lines
Diff to previous 1.16 (colored)

Make ripd(8) aware of MPLS routes.

ok claudio@

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jun 5 22:40:24 2009 UTC (15 years ago) by chris
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

rtm->rtm_hdrlen conversion

ok claudio@, henning@

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jun 2 21:43:36 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.14: +13 -3 lines
Diff to previous 1.14 (colored)

Same reject and blackhole route handling as in ospfd. Allow those routes
to be redistributed even though they point to 127.0.0.1. OK michele@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Mar 31 09:11:45 2009 UTC (15 years, 2 months ago) by michele
Branch: MAIN
Changes since 1.13: +12 -2 lines
Diff to previous 1.13 (colored)

Assign the correct metric to the routes learned from the kernel while ripd is
running.

Issue spotted and diff tested by Steven Surdock.
ok claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 9 12:47:42 2008 UTC (16 years, 1 month ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (colored)

prio RTP_RIP for inserted routes

Revision 1.12 / (download) - annotate - [select for diffs], Wed Oct 24 20:29:30 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

An u_int8_t is enough as prefixlen. Another lint warning gone.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Oct 18 17:00:59 2007 UTC (16 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

spacing

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 17 20:18:11 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.9: +7 -1 lines
Diff to previous 1.9 (colored)

Add missing RTM_VERSION checks.

Revision 1.5.2.1 / (download) - annotate - [select for diffs], Mon Apr 30 20:45:01 2007 UTC (17 years, 1 month ago) by ckuethe
Branch: OPENBSD_4_1
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

From claudio@
> ospfd and ripd a re busted in 4.1 because the are unable to track
> linkstates. This was fixed in 1.43 of ospfd/kroute.c and 1.6 of
> ripd/kroute.c.
>
> revision 1.43
> date: 2007/03/13 16:48:03;  author: claudio;  state: Exp;  lines: +4 -4
> rtm_tableid is only valid for RTM_ADD, RTM_CHANGE and RTM_DELETE but not
> for stuff like RTM_IFINFO or RTM_IFANNOUNCE. So move check to a save
> location.
> Always check rtm_type before accessing some random value inside the route
> message.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Apr 27 09:20:32 2007 UTC (17 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.8: +21 -3 lines
Diff to previous 1.8 (colored)

Ripd needs a valid route for 224.0.0.9 to work. Instead of forcing users to
set multicast_router=YES we inject a 224.0.0.9/32 route into the kernel and
remove the route on exit if the insert was successful. With this ripd
works out of the box.
OK michele@ norby@

Revision 1.8 / (download) - annotate - [select for diffs], Thu Apr 19 13:54:36 2007 UTC (17 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.7: +62 -34 lines
Diff to previous 1.7 (colored)

Use vectorized writes to send routing messages into the kernel instead of
using a static message structure. Similar diffs went into bgpd and ospfd.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Mar 19 10:23:42 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.6: +24 -2 lines
Diff to previous 1.6 (colored)

Doh! If we support "redistribute rtlabel" we should actually track the
routing labels in ripd's kroute code. Just steal the code from ospfd which
does it right.  OK michele@

Revision 1.6 / (download) - annotate - [select for diffs], Tue Mar 13 16:50:58 2007 UTC (17 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

Same problem as in ospfd's kroute.c don't check rtm_tableid without verifying
that rtm_type is one of RTM_ADD, RTM_CHANGE or RTM_DELETE.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Nov 28 19:21:15 2006 UTC (17 years, 6 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE
Branch point for: OPENBSD_4_1
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

add additional link states to report the half duplex / full duplex
state, if known by the driver. this is required to check the full
duplex state without depending on the ifmedia ioctl which can't be
called in the kernel without process context.

ok henning@, brad@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 28 16:36:58 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

mib we pass to sysctl when fetching the routing table has 7 entries now,
not 6 any more (rtableid added). need to tell sysctl so.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Nov 16 15:56:26 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
Changes since 1.2: +6 -2 lines
Diff to previous 1.2 (colored)

ignore messages for alternate routing tables for now; from bgpd

Revision 1.2 / (download) - annotate - [select for diffs], Tue Oct 24 16:37:48 2006 UTC (17 years, 7 months ago) by david
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

spelling and typo fixes

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 16:11:58 2006 UTC (17 years, 7 months ago) by norby
Branch: MAIN

Welcome ripd
started by Michele Marchetto some time ago by using the imsg/three process framework
of ospfd. He implemented most of the daemon with a little help and guidance from
Claudio and I.

Currently the daemon is more or less complete, with the exception of key lifetime
and rollover.

Not yet connected to the builds.
OK claudio@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.