summaryrefslogtreecommitdiff
path: root/net/ipv4/raw.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-07-07 10:58:50 +0900
committerDavid S. Miller <davem@davemloft.net>2018-07-07 10:58:50 +0900
commit9ebcb397aaaf6a18d35db0168375e183e9170f53 (patch)
tree9ab9ed3c9a6a5018df2faec2dab0b896aacd3bca /net/ipv4/raw.c
parentab8565af68001ac5f9331daa311938ead3eb5636 (diff)
parentfbf47813607ba8c4e5c5b81da3c47fc66ac314b1 (diff)
Merge branch 'sock-cookie-initializers'
Willem de Bruijn says: ==================== sock cookie initializers Recent UDP GSO and SO_TXTIME features added new fields to cookie structs. When adding a field, all sites where a struct is initialized have to be updated, which is a lot of boilerplate. Alternatively, a field can be initialized selectively, but this is fragile. I introduced a bug in udp gso where an uninitialized field was read. See also fix commit ("9887cba19978 ip: limit use of gso_size to udp"). Introduce initializers for structs ipcm(6)_cookie and sockc_cookie. patch 1..3 do exactly this. patch 4..5 make ipv4 and ipv6 handle cookies the same way and remove some boilerplate in doing so. patch 6 removes the udp gso branch that needed the above fix ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r--net/ipv4/raw.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 446af7be2b55..33df4d76db2d 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -562,14 +562,7 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
daddr = inet->inet_daddr;
}
- ipc.sockc.tsflags = sk->sk_tsflags;
- ipc.sockc.transmit_time = 0;
- ipc.addr = inet->inet_saddr;
- ipc.opt = NULL;
- ipc.tx_flags = 0;
- ipc.ttl = 0;
- ipc.tos = -1;
- ipc.oif = sk->sk_bound_dev_if;
+ ipcm_init_sk(&ipc, inet);
if (msg->msg_controllen) {
err = ip_cmsg_send(sk, msg, &ipc, false);
@@ -672,8 +665,6 @@ back_from_confirm:
&rt, msg->msg_flags, &ipc.sockc);
else {
- sock_tx_timestamp(sk, ipc.sockc.tsflags, &ipc.tx_flags);
-
if (!ipc.addr)
ipc.addr = fl4.daddr;
lock_sock(sk);