sctp: Store a flowi in transports to provide persistent keying.
authorDavid S. Miller <davem@davemloft.net>
Fri, 6 May 2011 23:32:47 +0000 (16:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 May 2011 21:05:14 +0000 (14:05 -0700)
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>
include/net/sctp/structs.h
net/sctp/transport.c

index ff3e8cce7d66d24a6abff51fe332b0999f5c1867..795f4886e1112dc7245e841f29f0465ae4aa1d59 100644 (file)
@@ -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;
index d8595dd1a8a7a87b9dcbda49ad820d7e731d9ca4..394c57ca2f54210e4060654fb72f1937aee3bc75 100644 (file)
@@ -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) {
@@ -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;