diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 01:12:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:48 -0500 |
commit | 9d6ec938019c6b16cb9ec96598ebe8f20de435fe (patch) | |
tree | 9b850eb7fd48a6e5ffc15f47afd2e3edc93f5290 /net/ipv4/raw.c | |
parent | 68a5e3dd0a0056d8b349f9eea3756adda53ec17a (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.c | 32 |
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: | |||
402 | return err; | 402 | return err; |
403 | } | 403 | } |
404 | 404 | ||
405 | static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) | 405 | static int raw_probe_proto_opt(struct flowi4 *fl4, struct msghdr *msg) |
406 | { | 406 | { |
407 | struct iovec *iov; | 407 | struct iovec *iov; |
408 | u8 __user *type = NULL; | 408 | u8 __user *type = NULL; |
@@ -418,7 +418,7 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) | |||
418 | if (!iov) | 418 | if (!iov) |
419 | continue; | 419 | continue; |
420 | 420 | ||
421 | switch (fl->flowi_proto) { | 421 | switch (fl4->flowi4_proto) { |
422 | case IPPROTO_ICMP: | 422 | case IPPROTO_ICMP: |
423 | /* check if one-byte field is readable or not. */ | 423 | /* check if one-byte field is readable or not. */ |
424 | if (iov->iov_base && iov->iov_len < 1) | 424 | if (iov->iov_base && iov->iov_len < 1) |
@@ -433,8 +433,8 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) | |||
433 | code = iov->iov_base; | 433 | code = iov->iov_base; |
434 | 434 | ||
435 | if (type && code) { | 435 | if (type && code) { |
436 | if (get_user(fl->fl4_icmp_type, type) || | 436 | if (get_user(fl4->uli.icmpt.type, type) || |
437 | get_user(fl->fl4_icmp_code, code)) | 437 | get_user(fl4->uli.icmpt.code, code)) |
438 | return -EFAULT; | 438 | return -EFAULT; |
439 | probed = 1; | 439 | probed = 1; |
440 | } | 440 | } |
@@ -548,23 +548,25 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
548 | } | 548 | } |
549 | 549 | ||
550 | { | 550 | { |
551 | struct flowi fl = { .flowi_oif = ipc.oif, | 551 | struct flowi4 fl4 = { |
552 | .flowi_mark = sk->sk_mark, | 552 | .flowi4_oif = ipc.oif, |
553 | .fl4_dst = daddr, | 553 | .flowi4_mark = sk->sk_mark, |
554 | .fl4_src = saddr, | 554 | .daddr = daddr, |
555 | .fl4_tos = tos, | 555 | .saddr = saddr, |
556 | .flowi_proto = inet->hdrincl ? IPPROTO_RAW : | 556 | .flowi4_tos = tos, |
557 | sk->sk_protocol, | 557 | .flowi4_proto = (inet->hdrincl ? |
558 | .flowi_flags = FLOWI_FLAG_CAN_SLEEP, | 558 | IPPROTO_RAW : |
559 | sk->sk_protocol), | ||
560 | .flowi4_flags = FLOWI_FLAG_CAN_SLEEP, | ||
559 | }; | 561 | }; |
560 | if (!inet->hdrincl) { | 562 | if (!inet->hdrincl) { |
561 | err = raw_probe_proto_opt(&fl, msg); | 563 | err = raw_probe_proto_opt(&fl4, msg); |
562 | if (err) | 564 | if (err) |
563 | goto done; | 565 | goto done; |
564 | } | 566 | } |
565 | 567 | ||
566 | security_sk_classify_flow(sk, &fl); | 568 | security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); |
567 | rt = ip_route_output_flow(sock_net(sk), &fl, sk); | 569 | rt = ip_route_output_flow(sock_net(sk), &fl4, sk); |
568 | if (IS_ERR(rt)) { | 570 | if (IS_ERR(rt)) { |
569 | err = PTR_ERR(rt); | 571 | err = PTR_ERR(rt); |
570 | goto done; | 572 | goto done; |