OpenBSD CVS

CVS log for src/sys/netmpls/mpls_output.c


[BACK] Up to [local] / src / sys / netmpls

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.29 / (download) - annotate - [select for diffs], Sat May 13 13:35:18 2023 UTC (12 months, 4 weeks ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.28: +4 -19 lines
Diff to previous 1.28 (colored)

Instead of implementing IPv4 header checksum creation everywhere,
introduce in_hdr_cksum_out().  It is used like in_proto_cksum_out().
OK claudio@

Revision 1.28 / (download) - annotate - [select for diffs], Tue Sep 3 10:39:08 2019 UTC (4 years, 9 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, 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, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

correct INET6 path in mpls_getttl() and avoid uninitialised variable
ok dlg@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Aug 27 00:49:48 2019 UTC (4 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.26: +27 -29 lines
Diff to previous 1.26 (colored)

use m_getptr to get to the right mbuf and offset for the ttl in mpls_gettl.

problem found by and this fix was tested by groos at xiplink dot com
on bugs@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Dec 2 08:47:00 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.25: +40 -64 lines
Diff to previous 1.25 (colored)

Rework the MPLS handling. Remove the lookup loops since nothing is using
them and they make everything so much harder with no gain. Remove the
ifp argument from mpls_input since it is not needed. On the input side
the lookup side is modified a bit when it comes to BOS handling.
Tested in a L3VPN setup with ldpd and bgpd. Commiting now so we can move
on with cleaning up rt_ifp usage. If this breaks L2VPN I will fix it once
reported. OK mpi@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Sep 23 08:49:46 2015 UTC (8 years, 8 months ago) by mpi
Branch: MAIN
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Always increment rt_use inside rtalloc(9) instead of doing it in some
specific places.

ok claudio@, benno@

Revision 1.24 / (download) - annotate - [select for diffs], Sun Sep 13 17:53:44 2015 UTC (8 years, 8 months ago) by mpi
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

There's no point in abstracting ifp->if_output() as long as pf_test()
needs to see lo0 in the output path.

ok claudio@

Revision 1.23 / (download) - annotate - [select for diffs], Sat Sep 12 20:26:07 2015 UTC (8 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.

Use instead the RTF_LOCAL flag to loop local traffic back to the
corresponding protocol queue.

With this change rt_ifp is now always the same as rt_ifa->ifa_ifp.

ok claudio@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Sep 12 14:21:04 2015 UTC (8 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.21: +11 -6 lines
Diff to previous 1.21 (colored)

Use rtfree() instead of playing with the refcount directly. Some care is
needed since rt0 as passed from the upper layer is freed by that layer.
Also if_output does not free the rt so handle that as well.
With and OK mpi@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jul 15 22:16:42 2015 UTC (8 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.20: +2 -3 lines
Diff to previous 1.20 (colored)

m_freem() can handle NULL, do not check for this condition beforehands.
ok stsp mpi

Revision 1.20 / (download) - annotate - [select for diffs], Tue Dec 23 03:24:08 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.19: +1 -5 lines
Diff to previous 1.19 (colored)

unifdef some more INET. v4 4life.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Dec 5 15:50:04 2014 UTC (9 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.

ok mikeb@, krw@, bluhm@, tedu@

Revision 1.18 / (download) - annotate - [select for diffs], Sat Nov 1 21:40:39 2014 UTC (9 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Rename rtalloc1() into rtalloc(9) and convert its flags to only enable
functionnality instead of a mix of enable/disable.

ok bluhm@, jca@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jul 22 11:06:10 2014 UTC (9 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (colored)

Fewer <netinet/in_systm.h> !

Revision 1.16 / (download) - annotate - [select for diffs], Wed Apr 24 10:20:15 2013 UTC (11 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.15: +1 -3 lines
Diff to previous 1.15 (colored)

Move various extern declarations into their corresponding header file.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Apr 4 17:44:43 2011 UTC (13 years, 2 months ago) by henning
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.14: +2 -4 lines
Diff to previous 1.14 (colored)

de-guttenberg our stack a bit
we don't need 7 f***ing copies of the same code to do the protocol checksums
(or not, depending on hw capabilities). claudio ok

Revision 1.14 / (download) - annotate - [select for diffs], Mon Apr 4 16:20:02 2011 UTC (13 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.13: +2 -4 lines
Diff to previous 1.13 (colored)

no need to check the csum flags before calling mpls_do_cksum which
immediately checks exactly those flags, claudio ok

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 21 17:42:57 2011 UTC (13 years, 4 months ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.12: +5 -1 lines
Diff to previous 1.12 (colored)

make mpls compile w/o errors when inet6 is not defined

diff from form@ who's too busy drinking vodka with pelmeni to commit this;
ok claudio

Revision 1.12 / (download) - annotate - [select for diffs], Wed Sep 8 08:00:56 2010 UTC (13 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.11: +49 -3 lines
Diff to previous 1.11 (colored)

Map the TTL when building the initial MPLS stack from the encapsulated
packet. For IP and IPv6 the corresponding mapttl sysctl needs to be set.
This is needed to make traceroute work over MPLS.
OK michele@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jul 7 14:50:02 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.10: +1 -3 lines
Diff to previous 1.10 (colored)

Remove duplicate mtod(). No need to do it twice since the mbuf is not
modified in between.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jun 2 15:41:07 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Kill the mpls enable sysctl knob. Since MPLS needs to be enabled explicitly
on each interface there is no need for yet another knob.
OK michele@

Revision 1.9 / (download) - annotate - [select for diffs], Fri May 28 12:09:10 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.8: +96 -50 lines
Diff to previous 1.8 (colored)

Rework the way we handle MPLS in the kernel. Instead of fumbling MPLS into
ether_output() and later on other L2 output functions use a trick and over-
load the ifp->if_output() function pointer on MPLS enabled interfaces to
go through mpls_output() which will then call the link level output function.
By setting IFXF_MPLS on an interface the output pointers are switched.
This now allows to cleanup the MPLS input and output pathes and fix mpe(4)
so that the MPLS code now actually works for both P and PE systems.
Tested by myself and michele
(A custom kernel with MPLS and mpe enabled is still needed).

Revision 1.8 / (download) - annotate - [select for diffs], Fri May 7 13:33:17 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1
accept flags for report and nocloning. Move the rtableid into struct route
(with a minor twist for now) and make a few more codepathes rdomain aware.
Appart from the pf.c and route.c bits the diff is mostly mechanical.
More to come...
OK michele, henning

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jul 9 12:55:35 2009 UTC (14 years, 11 months ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored)

Remove commented variable.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Apr 29 19:26:52 2009 UTC (15 years, 1 month ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.5: +5 -3 lines
Diff to previous 1.5 (colored)

Split up functionalities between mpls_input and mpls_output.
The former is responsible to handle packets destined to localhost,
the latter handles packet that have to be forwarded or the ones
originated from localhost.

"i like it" claudio@

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jan 28 22:18:44 2009 UTC (15 years, 4 months ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.4: +53 -72 lines
Diff to previous 1.4 (colored)

Get rid of the ugly rtentry hack.

We can now act as edge node and allow ipv4 packets to
enter a Label Switched Path and not just forwarding
MPLS packets.

OK claudio@

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jan 8 12:47:45 2009 UTC (15 years, 5 months ago) by michele
Branch: MAIN
Changes since 1.3: +16 -9 lines
Diff to previous 1.3 (colored)

Fix sockaddr_mpls structure.
Now it contains just the label as it must be.

This introduces a ugly hack in rtentry that will be removed
as soon as possible.

OK claudio@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Dec 15 16:13:55 2008 UTC (15 years, 5 months ago) by michele
Branch: MAIN
Changes since 1.2: +7 -10 lines
Diff to previous 1.2 (colored)

Initial fixup of sockaddr_mpls struct.

Remove smpls_in_iface as labels must be per platform unique.
Remove smpls_out_iface. It is redudant and can be inferred from nexthop.
Move smpls_operation to rt_flags and temporary remove smpls_out_exp.

ok claudio@

Revision 1.2 / (download) - annotate - [select for diffs], Thu Nov 6 19:32:51 2008 UTC (15 years, 7 months ago) by michele
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

Fix cvs id tag.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Oct 28 01:16:14 2008 UTC (15 years, 7 months ago) by michele
Branch: MAIN

Added mpls_output() used to output mpls packets originating from local host.
Strictly similar to mpls_input().

Input and OK claudio@, OK laurent@

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.