diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 00:00:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:42 -0500 |
commit | 78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch) | |
tree | 9dccc5c16bf269d53d8499064ec95a998e84c646 /net/rxrpc | |
parent | 1561747ddf9d28185548687b11aae7074d6129c4 (diff) |
ipv4: Create and use route lookup helpers.
The idea here is this minimizes the number of places one has to edit
in order to make changes to how flows are defined and used.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/ar-peer.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c index 3620c569275f..55b93dc60d0c 100644 --- a/net/rxrpc/ar-peer.c +++ b/net/rxrpc/ar-peer.c | |||
@@ -36,28 +36,13 @@ static void rxrpc_destroy_peer(struct work_struct *work); | |||
36 | static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer) | 36 | static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer) |
37 | { | 37 | { |
38 | struct rtable *rt; | 38 | struct rtable *rt; |
39 | struct flowi fl; | ||
40 | 39 | ||
41 | peer->if_mtu = 1500; | 40 | peer->if_mtu = 1500; |
42 | 41 | ||
43 | memset(&fl, 0, sizeof(fl)); | 42 | rt = ip_route_output_ports(&init_net, NULL, |
44 | 43 | peer->srx.transport.sin.sin_addr.s_addr, 0, | |
45 | switch (peer->srx.transport.family) { | 44 | htons(7000), htons(7001), |
46 | case AF_INET: | 45 | IPPROTO_UDP, 0, 0); |
47 | fl.oif = 0; | ||
48 | fl.proto = IPPROTO_UDP, | ||
49 | fl.fl4_dst = peer->srx.transport.sin.sin_addr.s_addr; | ||
50 | fl.fl4_src = 0; | ||
51 | fl.fl4_tos = 0; | ||
52 | /* assume AFS.CM talking to AFS.FS */ | ||
53 | fl.fl_ip_sport = htons(7001); | ||
54 | fl.fl_ip_dport = htons(7000); | ||
55 | break; | ||
56 | default: | ||
57 | BUG(); | ||
58 | } | ||
59 | |||
60 | rt = ip_route_output_key(&init_net, &fl); | ||
61 | if (IS_ERR(rt)) { | 46 | if (IS_ERR(rt)) { |
62 | _leave(" [route err %ld]", PTR_ERR(rt)); | 47 | _leave(" [route err %ld]", PTR_ERR(rt)); |
63 | return; | 48 | return; |