2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

sock: Do strict socket family checks when looking up collected socket

We hash socket with inode and family, but search only by inode. Well,
yes, family should match, since all sockets are in one sockfs in kernel,
but let's make sure _we_ did things right by checking the family as well.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-08-15 19:16:12 +04:00
parent da2ebabf86
commit fb5a5671c8
5 changed files with 36 additions and 10 deletions

View File

@@ -47,9 +47,10 @@ extern char *sktype2s(u32 t);
extern char *skproto2s(u32 p);
extern char *skstate2s(u32 state);
extern struct socket_desc *lookup_socket(int ino);
extern struct socket_desc *lookup_socket(int ino, int family);
extern int dump_one_inet(struct fd_parms *p, int lfd, const struct cr_fdset *set);
extern int dump_one_inet6(struct fd_parms *p, int lfd, const struct cr_fdset *set);
extern int dump_one_unix(struct fd_parms *p, int lfd, const struct cr_fdset *set);
extern int inet_collect_one(struct nlmsghdr *h, int family, int type, int proto);