OpenBSD CVS

CVS log for src/usr.sbin/rtadvd/Attic/if.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.47, Mon Jul 23 12:04:46 2018 UTC (5 years, 10 months ago) by florian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.46: +1 -1 lines
FILE REMOVED

Remove rtadvd(8), it's time to switch to rad(8).

Revision 1.46 / (download) - annotate - [select for diffs], Sat Aug 12 07:38:26 2017 UTC (6 years, 9 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.45: +13 -24 lines
Diff to previous 1.45 (colored)

No need to constantly re-open a socket. Just open it up front and keep
it around.
OK jca

Revision 1.45 / (download) - annotate - [select for diffs], Thu Aug 10 19:07:14 2017 UTC (6 years, 9 months ago) by jca
Branch: MAIN
Changes since 1.44: +60 -70 lines
Diff to previous 1.44 (colored)

No need to handle multiple routing messages here.

route(4) sockets only ever ship a single routing message per read(2)
call, so simplify this.  Mostly mechanical diff for now, some further
cleanups will follow.

ok rob@ florian@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Jul 12 06:11:45 2017 UTC (6 years, 10 months ago) by florian
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

errno is not set, use log_warnx
OK benno

Revision 1.43 / (download) - annotate - [select for diffs], Wed Jul 12 06:11:07 2017 UTC (6 years, 10 months ago) by florian
Branch: MAIN
Changes since 1.42: +3 -5 lines
Diff to previous 1.42 (colored)

replace
log_warnx("foo");
exit(1);
with
fatalx("foo);
OK benno

Revision 1.42 / (download) - annotate - [select for diffs], Wed Jul 12 06:09:03 2017 UTC (6 years, 10 months ago) by florian
Branch: MAIN
Changes since 1.41: +4 -2 lines
Diff to previous 1.41 (colored)

Don't clobber errno, we want to log_warn what went wrong.
OK benno, millert

Revision 1.41 / (download) - annotate - [select for diffs], Tue Aug 2 17:00:09 2016 UTC (7 years, 10 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

Move to libevent; ok florian@

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jun 29 14:19:38 2016 UTC (7 years, 11 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.39: +14 -40 lines
Diff to previous 1.39 (colored)

Spring cleanup

- pointless casts, kill caddr_t or replace it with char *
- signed counters
- simplify if_getmtu, only one method is needed and SIOCGIFMTU is the
  cheapest
- we no longer have drivers for IFT_FDDI
- hide details of iflist management
- if (dflag) log_debug -> log_debug
- dead code and comments
- etc etc

Input from and ok florian@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Mar 1 20:51:05 2016 UTC (8 years, 3 months ago) by jca
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

fatal("malloc") -> fatal(NULL)

Revision 1.38 / (download) - annotate - [select for diffs], Tue Mar 1 12:52:43 2016 UTC (8 years, 3 months ago) by jca
Branch: MAIN
Changes since 1.37: +1 -3 lines
Diff to previous 1.37 (colored)

Pointless 'return;' in void functions

Revision 1.37 / (download) - annotate - [select for diffs], Mon Feb 8 23:19:00 2016 UTC (8 years, 4 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.36: +5 -5 lines
Diff to previous 1.36 (colored)

Kill trailing whitespace.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Feb 5 11:26:26 2016 UTC (8 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.35: +5 -3 lines
Diff to previous 1.35 (colored)

rtadvd used a strncpy with a src interface name from the command line
without checking its length.  Replace it with strlcpy, check for
truncation and move the check before using the user-specified
interface name.  While here, replace another strncpy of a interface
name with memset-zero + strlcpy and check for truncation in
if_getmtu() (should not happen as we validated the length before, but
it's better to be safe and generally a better practice).

OK jsg@

Revision 1.35 / (download) - annotate - [select for diffs], Fri Dec 11 20:15:52 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
Changes since 1.34: +2 -3 lines
Diff to previous 1.34 (colored)

Remove NULL-checks before free().

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 1 12:11:31 2015 UTC (8 years, 6 months ago) by jca
Branch: MAIN
Changes since 1.33: +2 -6 lines
Diff to previous 1.33 (colored)

Use setsockopt(ROUTE_MSGFILTER) instead of hand-rolled filtering.

ok florian@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Dec 1 12:09:36 2015 UTC (8 years, 6 months ago) by jca
Branch: MAIN
Changes since 1.32: +1 -2 lines
Diff to previous 1.32 (colored)

This RTM_GET case can't trigger due to the filtering done above.

ok florian@

Revision 1.32 / (download) - annotate - [select for diffs], Mon Nov 30 20:58:08 2015 UTC (8 years, 6 months ago) by jca
Branch: MAIN
Changes since 1.31: +3 -12 lines
Diff to previous 1.31 (colored)

Clean up get_next_msg(): kill dead argument/code

The "ifindex" argument has always been zero, making the interface index
checks within get_next_msg() useless.  The caller already properly
retrieves and handle the interface index of the routing messages.

ok florian@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Nov 30 12:44:36 2015 UTC (8 years, 6 months ago) by jca
Branch: MAIN
Changes since 1.30: +3 -7 lines
Diff to previous 1.30 (colored)

Fix dynamic prefix tracking.

This code should not be using RTAX_GATEWAY to retrieve the interface
index.  Also this index is meaningless within get_next_msg(), further
cleanup is planned.

Issue reported by Sly Midnight on bugs@, ok mpi@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 3 15:59:31 2015 UTC (8 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.29: +3 -1 lines
Diff to previous 1.29 (colored)

Recognize carp(4) interfaces (yes, they are special...) in order to send
the src lladdr option.

Problem reported and diff provided by Lauri Tirkkonen on bugs@

ok sthen@

Revision 1.29 / (download) - annotate - [select for diffs], Sun Oct 25 22:11:34 2015 UTC (8 years, 7 months ago) by jca
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

ansify

Revision 1.28 / (download) - annotate - [select for diffs], Thu Aug 20 22:39:29 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

stdlib.h is in scope; do not cast malloc/calloc/realloc*
ok millert krw

Revision 1.27 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:20 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.26: +1 -2 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Sun Jun 29 00:58:45 2014 UTC (9 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)

If you want <sys/queue.h>, you need to include it.  Don't assume that
<sys/sysctl.h> will pull in the universe (I am working on breaking that
assumption in a gentle fashion)

Revision 1.25 / (download) - annotate - [select for diffs], Thu Mar 21 04:43:15 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.24: +15 -9 lines
Diff to previous 1.24 (colored)

create realloc() loops around sysctl for array-based mibs, in programs
which want a "full" dump
ok dlg

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jul 5 05:13:04 2011 UTC (12 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: 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: +5 -6 lines
Diff to previous 1.23 (colored)

Do not use (ifam + 1) to find the start of the sockaddrs. Use the
rtm_hdrlen instead. Also move the ifindex check way further up.
OK dlg@ bluhm@

Revision 1.23 / (download) - annotate - [select for diffs], Fri May 21 13:41:23 2010 UTC (14 years ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.22: +1 -22 lines
Diff to previous 1.22 (colored)

remove unused functions

from tobias@ (loooooong time ago)

ok rainer@ henning@ tobias@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jul 11 09:51:53 2009 UTC (14 years, 11 months ago) by rainer
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.21: +3 -7 lines
Diff to previous 1.21 (colored)

fix the RTM_VERSION check in the evil loop to really get
all the interfaces

ok sthen@

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jul 10 13:15:43 2009 UTC (14 years, 11 months ago) by sthen
Branch: MAIN
Changes since 1.20: +4 -2 lines
Diff to previous 1.20 (colored)

Advance the pointer past the message on the routing socket where
ifm_version is not RTM_VERSION - the for() loop doesn't do this itself.
Fixes endless loop introduced by preceding commit, noticed by marc@.
ok claudio.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jul 7 20:58:47 2009 UTC (14 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.19: +6 -3 lines
Diff to previous 1.19 (colored)

Forgot to commit this while adding all the RTM_VERSION checks. Reminded by
sthen@ who also tested it. OK henning@ sthen@

Revision 1.19 / (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.18: +6 -6 lines
Diff to previous 1.18 (colored)

rtm->rtm_hdrlen conversion

ok claudio@, henning@

Revision 1.18 / (download) - annotate - [select for diffs], Mon Apr 21 20:40:55 2008 UTC (16 years, 1 month ago) by rainer
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.17: +26 -41 lines
Diff to previous 1.17 (colored)

Clean up logging by introducing the logging API used in
other daemons and clean up the command line options.
For details, see rtadvd(8).

ok bluhm@, pyr@

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 16 16:08:15 2006 UTC (17 years, 6 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.16: +4 -1 lines
Diff to previous 1.16 (colored)

ignore messages for routing tables other than the main one

Revision 1.16 / (download) - annotate - [select for diffs], Tue Sep 23 18:18:09 2003 UTC (20 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.15: +19 -43 lines
Diff to previous 1.15 (colored)

simplify by using getifaddrs.  cedric@ ok

Revision 1.15 / (download) - annotate - [select for diffs], Sun Sep 21 04:06:01 2003 UTC (20 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.14: +13 -12 lines
Diff to previous 1.14 (colored)

plug memory leak.  from kame.  fgsch ok

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jun 10 19:57:35 2002 UTC (22 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.13: +11 -11 lines
Diff to previous 1.13 (colored)

Kill __FUNCTION__.
ok itojun@

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jun 9 00:56:09 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

do not use \n in syslog()

Revision 1.12 / (download) - annotate - [select for diffs], Tue May 21 23:29:46 2002 UTC (22 years ago) by itojun
Branch: MAIN
Changes since 1.11: +18 -28 lines
Diff to previous 1.11 (colored)

minor KNF.  plug a memory leak on reconfig.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Feb 17 19:42:39 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)

Revision 1.10 / (download) - annotate - [select for diffs], Sat Feb 16 21:28:08 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jan 21 15:42:35 2001 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

sync router renumbering flag bit to conform to 2292bis-02 and RR RFC.
sync with latest kame rtadvd (again).  mostly cosmetic.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jan 21 15:11:18 2001 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.7: +2 -13 lines
Diff to previous 1.7 (colored)

do not intsall rtadvd.conf into /etc, it is not required to use it
(rtadvd will derive the configuration from kernel settings).

make it clearer that rtadvd.conf is not necessary, in manpage.

sync with kame.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 15 11:06:25 2001 UTC (23 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.6: +35 -26 lines
Diff to previous 1.6 (colored)

sync with latest kame tree.
- reduce chances for signal handler rae condition
- decrease chances for misconfiguration
- feedbacks from router renumbering protocol bakeoff
- cleanups related to mtu handling

Revision 1.3.2.1 / (download) - annotate - [select for diffs], Sat Oct 21 05:19:33 2000 UTC (23 years, 7 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.3: +3 -4 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

Pull in patch from current:
Fix (itojun):
repair a routine to grab interface MTU information.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Sep 1 01:24:04 2000 UTC (23 years, 9 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

repair a routine to grab interface MTU information.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 6 10:14:46 2000 UTC (23 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.4: +5 -7 lines
Diff to previous 1.4 (colored)

sync with router renumber struct decl change.
more logs.  make it very sure to close temporary socket.

Revision 1.4 / (download) - annotate - [select for diffs], Tue May 23 11:23:23 2000 UTC (24 years ago) by itojun
Branch: MAIN
Changes since 1.3: +4 -6 lines
Diff to previous 1.3 (colored)

sync with latest kame.
- weaken logging priority for /etc/resolv.conf open failure
- gather stats, emit stats by SIGUSR1
- use SIOCGIFMTU to get interface MTU (just a matter of #ifdef)
From: "Todd T. Fries" <todd@fries.net>

Revision 1.3 / (download) - annotate - [select for diffs], Mon Mar 13 06:16:11 2000 UTC (24 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE
Branch point for: OPENBSD_2_7
Changes since 1.2: +6 -5 lines
Diff to previous 1.2 (colored)

bring in latest rtadvd source from kame.
this fixes unclosed file descriptor in router renumbering case.

Revision 1.2 / (download) - annotate - [select for diffs], Sat Dec 11 10:33:28 1999 UTC (24 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.1: +2 -0 lines
Diff to previous 1.1 (colored)

enable rtadvd in usr.sbin/Makefile.
rcsid police on usr.sbin/rtadvd.
add sample config into etc/rtadvd.conf.
add files into distrib/sets/list.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sat Dec 11 10:23:28 1999 UTC (24 years, 6 months ago) by itojun
Branch: KAME
CVS Tags: kame_19991211
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

router advertisement daemon, from KAME

Revision 1.1 / (download) - annotate - [select for diffs], Sat Dec 11 10:23:28 1999 UTC (24 years, 6 months ago) by itojun
Branch: MAIN

Initial revision

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.