diff options
-rw-r--r-- | net/ipv4/raw.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 2d3c72e5bbbf..7d32d9d57152 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -548,17 +548,13 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
548 | } | 548 | } |
549 | 549 | ||
550 | { | 550 | { |
551 | struct flowi4 fl4 = { | 551 | struct flowi4 fl4; |
552 | .flowi4_oif = ipc.oif, | 552 | |
553 | .flowi4_mark = sk->sk_mark, | 553 | flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, |
554 | .daddr = daddr, | 554 | RT_SCOPE_UNIVERSE, |
555 | .saddr = saddr, | 555 | inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol, |
556 | .flowi4_tos = tos, | 556 | FLOWI_FLAG_CAN_SLEEP, daddr, saddr, 0, 0); |
557 | .flowi4_proto = (inet->hdrincl ? | 557 | |
558 | IPPROTO_RAW : | ||
559 | sk->sk_protocol), | ||
560 | .flowi4_flags = FLOWI_FLAG_CAN_SLEEP, | ||
561 | }; | ||
562 | if (!inet->hdrincl) { | 558 | if (!inet->hdrincl) { |
563 | err = raw_probe_proto_opt(&fl4, msg); | 559 | err = raw_probe_proto_opt(&fl4, msg); |
564 | if (err) | 560 | if (err) |