summaryrefslogtreecommitdiff
path: root/net/ipv4/raw.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 01:12:47 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 15:08:48 -0800
commit9d6ec938019c6b16cb9ec96598ebe8f20de435fe (patch)
tree9b850eb7fd48a6e5ffc15f47afd2e3edc93f5290 /net/ipv4/raw.c
parent68a5e3dd0a0056d8b349f9eea3756adda53ec17a (diff)
ipv4: Use flowi4 in public route lookup interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r--net/ipv4/raw.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 333b826c1871..452e178d962d 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -402,7 +402,7 @@ error:
return err;
}
-static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
+static int raw_probe_proto_opt(struct flowi4 *fl4, struct msghdr *msg)
{
struct iovec *iov;
u8 __user *type = NULL;
@@ -418,7 +418,7 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
if (!iov)
continue;
- switch (fl->flowi_proto) {
+ switch (fl4->flowi4_proto) {
case IPPROTO_ICMP:
/* check if one-byte field is readable or not. */
if (iov->iov_base && iov->iov_len < 1)
@@ -433,8 +433,8 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
code = iov->iov_base;
if (type && code) {
- if (get_user(fl->fl4_icmp_type, type) ||
- get_user(fl->fl4_icmp_code, code))
+ if (get_user(fl4->uli.icmpt.type, type) ||
+ get_user(fl4->uli.icmpt.code, code))
return -EFAULT;
probed = 1;
}
@@ -548,23 +548,25 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
}
{
- struct flowi fl = { .flowi_oif = ipc.oif,
- .flowi_mark = sk->sk_mark,
- .fl4_dst = daddr,
- .fl4_src = saddr,
- .fl4_tos = tos,
- .flowi_proto = inet->hdrincl ? IPPROTO_RAW :
- sk->sk_protocol,
- .flowi_flags = FLOWI_FLAG_CAN_SLEEP,
+ struct flowi4 fl4 = {
+ .flowi4_oif = ipc.oif,
+ .flowi4_mark = sk->sk_mark,
+ .daddr = daddr,
+ .saddr = saddr,
+ .flowi4_tos = tos,
+ .flowi4_proto = (inet->hdrincl ?
+ IPPROTO_RAW :
+ sk->sk_protocol),
+ .flowi4_flags = FLOWI_FLAG_CAN_SLEEP,
};
if (!inet->hdrincl) {
- err = raw_probe_proto_opt(&fl, msg);
+ err = raw_probe_proto_opt(&fl4, msg);
if (err)
goto done;
}
- security_sk_classify_flow(sk, &fl);
- rt = ip_route_output_flow(sock_net(sk), &fl, sk);
+ security_sk_classify_flow(sk, flowi4_to_flowi(&fl4));
+ rt = ip_route_output_flow(sock_net(sk), &fl4, sk);
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
goto done;