diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-07 01:23:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-08 18:28:28 -0400 |
commit | d9d8da805dcb503ef8ee49918a94d49085060f23 (patch) | |
tree | ede7d2af74c2982eb24430079aea63c05a3420e9 /net/l2tp | |
parent | 0e734419923bd8e599858f8fc196c7804bb85564 (diff) |
inet: Pass flowi to ->queue_xmit().
This allows us to acquire the exact route keying information from the
protocol, however that might be managed.
It handles all of the possibilities, from the simplest case of storing
the key in inet->cork.fl to the more complex setup SCTP has where
individual transports determine the flow.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r-- | net/l2tp/l2tp_core.c | 10 | ||||
-rw-r--r-- | net/l2tp/l2tp_ip.c | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 78530299ae38..9be095e00450 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
@@ -954,7 +954,7 @@ static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf) | |||
954 | } | 954 | } |
955 | 955 | ||
956 | static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, | 956 | static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, |
957 | size_t data_len) | 957 | struct flowi *fl, size_t data_len) |
958 | { | 958 | { |
959 | struct l2tp_tunnel *tunnel = session->tunnel; | 959 | struct l2tp_tunnel *tunnel = session->tunnel; |
960 | unsigned int len = skb->len; | 960 | unsigned int len = skb->len; |
@@ -987,7 +987,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, | |||
987 | 987 | ||
988 | /* Queue the packet to IP for output */ | 988 | /* Queue the packet to IP for output */ |
989 | skb->local_df = 1; | 989 | skb->local_df = 1; |
990 | error = ip_queue_xmit(skb); | 990 | error = ip_queue_xmit(skb, fl); |
991 | 991 | ||
992 | /* Update stats */ | 992 | /* Update stats */ |
993 | if (error >= 0) { | 993 | if (error >= 0) { |
@@ -1028,6 +1028,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1028 | int data_len = skb->len; | 1028 | int data_len = skb->len; |
1029 | struct l2tp_tunnel *tunnel = session->tunnel; | 1029 | struct l2tp_tunnel *tunnel = session->tunnel; |
1030 | struct sock *sk = tunnel->sock; | 1030 | struct sock *sk = tunnel->sock; |
1031 | struct flowi *fl; | ||
1031 | struct udphdr *uh; | 1032 | struct udphdr *uh; |
1032 | struct inet_sock *inet; | 1033 | struct inet_sock *inet; |
1033 | __wsum csum; | 1034 | __wsum csum; |
@@ -1070,10 +1071,11 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1070 | skb_dst_drop(skb); | 1071 | skb_dst_drop(skb); |
1071 | skb_dst_set(skb, dst_clone(__sk_dst_get(sk))); | 1072 | skb_dst_set(skb, dst_clone(__sk_dst_get(sk))); |
1072 | 1073 | ||
1074 | inet = inet_sk(sk); | ||
1075 | fl = &inet->cork.fl; | ||
1073 | switch (tunnel->encap) { | 1076 | switch (tunnel->encap) { |
1074 | case L2TP_ENCAPTYPE_UDP: | 1077 | case L2TP_ENCAPTYPE_UDP: |
1075 | /* Setup UDP header */ | 1078 | /* Setup UDP header */ |
1076 | inet = inet_sk(sk); | ||
1077 | __skb_push(skb, sizeof(*uh)); | 1079 | __skb_push(skb, sizeof(*uh)); |
1078 | skb_reset_transport_header(skb); | 1080 | skb_reset_transport_header(skb); |
1079 | uh = udp_hdr(skb); | 1081 | uh = udp_hdr(skb); |
@@ -1111,7 +1113,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1111 | 1113 | ||
1112 | l2tp_skb_set_owner_w(skb, sk); | 1114 | l2tp_skb_set_owner_w(skb, sk); |
1113 | 1115 | ||
1114 | l2tp_xmit_core(session, skb, data_len); | 1116 | l2tp_xmit_core(session, skb, fl, data_len); |
1115 | out_unlock: | 1117 | out_unlock: |
1116 | bh_unlock_sock(sk); | 1118 | bh_unlock_sock(sk); |
1117 | 1119 | ||
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 1ca74892ff09..f7fb09ecaf89 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -508,7 +508,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m | |||
508 | skb_dst_set(skb, dst_clone(&rt->dst)); | 508 | skb_dst_set(skb, dst_clone(&rt->dst)); |
509 | 509 | ||
510 | /* Queue the packet to IP for output */ | 510 | /* Queue the packet to IP for output */ |
511 | rc = ip_queue_xmit(skb); | 511 | rc = ip_queue_xmit(skb, &inet->cork.fl); |
512 | 512 | ||
513 | error: | 513 | error: |
514 | /* Update stats */ | 514 | /* Update stats */ |