Skip to content

Commit ef164ae

Browse files
committed
ipv4: Use flowi4_init_output() in raw_sendmsg()
Signed-off-by: David S. Miller <[email protected]>
1 parent 538de0e commit ef164ae

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

net/ipv4/raw.c

+7-11
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,13 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
548548
}
549549

550550
{
551-
struct flowi4 fl4 = {
552-
.flowi4_oif = ipc.oif,
553-
.flowi4_mark = sk->sk_mark,
554-
.daddr = daddr,
555-
.saddr = saddr,
556-
.flowi4_tos = tos,
557-
.flowi4_proto = (inet->hdrincl ?
558-
IPPROTO_RAW :
559-
sk->sk_protocol),
560-
.flowi4_flags = FLOWI_FLAG_CAN_SLEEP,
561-
};
551+
struct flowi4 fl4;
552+
553+
flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos,
554+
RT_SCOPE_UNIVERSE,
555+
inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol,
556+
FLOWI_FLAG_CAN_SLEEP, daddr, saddr, 0, 0);
557+
562558
if (!inet->hdrincl) {
563559
err = raw_probe_proto_opt(&fl4, msg);
564560
if (err)

0 commit comments

Comments
 (0)