Skip to contentSkip to conversation

Pass the stored sock->protocol into sock_create() on restore

PATCH New Dan Smith 1 participant 1 message Oct 8, 2009 Networking

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

PATCH 1/1 Pass the stored sock->protocol into sock_create() on restore

This should be fine because the protocol sanity-checks the number to make sure it's valid given the type specified.

---
 net/checkpoint.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/checkpoint.c +2 -1
index 9a72aae..dd23efd 100644
@@ -687,7 +687,8 @@ struct sock *do_sock_restore(struct ckpt_ctx *ctx)
 	/* silently clear flags, e.g. SOCK_NONBLOCK or SOCK_CLOEXEC */
 	h->sock.type &= SOCK_TYPE_MASK;
 
-	ret = sock_create(h->sock_common.family, h->sock.type, 0, &sock);
+	ret = sock_create(h->sock_common.family, h->sock.type,
+			  h->sock.protocol, &sock);
 	if (ret < 0)
 		goto err;
 
Signature · 1 line
1.6.2.5