Skip to content

Commit

Permalink
sctp: Store a flowi in transports to provide persistent keying.
Browse files Browse the repository at this point in the history
Several future simplifications are possible now because of this.

For example, the sctp_addr unions can simply refer directly to
the flowi information.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 8, 2011
1 parent b57ae01 commit 8663c93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ struct sctp_transport {
/* Is this structure kfree()able? */
malloced:1;

struct flowi fl;

/* This is the peer's IP address and port. */
union sctp_addr ipaddr;
Expand Down
9 changes: 3 additions & 6 deletions net/sctp/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,11 @@ void sctp_transport_set_owner(struct sctp_transport *transport,
/* Initialize the pmtu of a transport. */
void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk)
{
struct flowi fl;

/* If we don't have a fresh route, look one up */
if (!transport->dst || transport->dst->obsolete > 1) {
dst_release(transport->dst);
transport->af_specific->get_dst(transport, &transport->saddr,
&fl, sk);
&transport->fl, sk);
}

if (transport->dst) {
Expand Down Expand Up @@ -274,14 +272,13 @@ void sctp_transport_route(struct sctp_transport *transport,
{
struct sctp_association *asoc = transport->asoc;
struct sctp_af *af = transport->af_specific;
struct flowi fl;

af->get_dst(transport, saddr, &fl, sctp_opt2sk(opt));
af->get_dst(transport, saddr, &transport->fl, sctp_opt2sk(opt));

if (saddr)
memcpy(&transport->saddr, saddr, sizeof(union sctp_addr));
else
af->get_saddr(opt, transport, &fl);
af->get_saddr(opt, transport, &transport->fl);

if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {
return;
Expand Down

0 comments on commit 8663c93

Please sign in to comment.