| .. | .. |
|---|
| 559 | 559 | } |
|---|
| 560 | 560 | |
|---|
| 561 | 561 | ipcm_init_sk(&ipc, inet); |
|---|
| 562 | + /* Keep backward compat */ |
|---|
| 563 | + if (hdrincl) |
|---|
| 564 | + ipc.protocol = IPPROTO_RAW; |
|---|
| 562 | 565 | |
|---|
| 563 | 566 | if (msg->msg_controllen) { |
|---|
| 564 | 567 | err = ip_cmsg_send(sk, msg, &ipc, false); |
|---|
| .. | .. |
|---|
| 626 | 629 | |
|---|
| 627 | 630 | flowi4_init_output(&fl4, ipc.oif, ipc.sockc.mark, tos, |
|---|
| 628 | 631 | RT_SCOPE_UNIVERSE, |
|---|
| 629 | | - hdrincl ? IPPROTO_RAW : sk->sk_protocol, |
|---|
| 632 | + hdrincl ? ipc.protocol : sk->sk_protocol, |
|---|
| 630 | 633 | inet_sk_flowi_flags(sk) | |
|---|
| 631 | 634 | (hdrincl ? FLOWI_FLAG_KNOWN_NH : 0), |
|---|
| 632 | 635 | daddr, saddr, 0, 0, sk->sk_uid); |
|---|