# HG changeset patch # User Roy Marples # Date 1601740856 -3600 # Node ID 41d06921177b00f65a2839a207699e50e2e8b2f4 # Parent 9fe902232341d865dbac7a6772a51e1954b0c691 privsep: We need getsockopt as well as setsockopt on the link socket So we can report receive buffer size. Important for route(4) overflow so we can try and set a bigger buffer. diff -r 9fe902232341 -r 41d06921177b src/if-bsd.c --- a/src/if-bsd.c Fri Oct 02 15:57:01 2020 +0100 +++ b/src/if-bsd.c Sat Oct 03 17:00:56 2020 +0100 @@ -216,8 +216,10 @@ #endif #ifdef PRIVSEP_RIGHTS + /* We need to getsockopt for SO_RCVBUF and + * setsockopt for RO_MISSFILTER. */ if (IN_PRIVSEP(ctx)) - ps_rights_limit_fd_setsockopt(ctx->link_fd); + ps_rights_limit_fd_sockopt(ctx->link_fd); #endif return 0; diff -r 9fe902232341 -r 41d06921177b src/privsep.c --- a/src/privsep.c Fri Oct 02 15:57:01 2020 +0100 +++ b/src/privsep.c Sat Oct 03 17:00:56 2020 +0100 @@ -260,11 +260,12 @@ } int -ps_rights_limit_fd_setsockopt(int fd) +ps_rights_limit_fd_sockopt(int fd) { cap_rights_t rights; - cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_EVENT, CAP_SETSOCKOPT); + cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_EVENT, + CAP_GETSOCKOPT, CAP_SETSOCKOPT); if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) return -1; return 0; diff -r 9fe902232341 -r 41d06921177b src/privsep.h --- a/src/privsep.h Fri Oct 02 15:57:01 2020 +0100 +++ b/src/privsep.h Sat Oct 03 17:00:56 2020 +0100 @@ -197,7 +197,7 @@ int ps_rights_limit_ioctl(int); int ps_rights_limit_fd_fctnl(int); int ps_rights_limit_fd_rdonly(int); -int ps_rights_limit_fd_setsockopt(int); +int ps_rights_limit_fd_sockopt(int); int ps_rights_limit_fd(int); int ps_rights_limit_fdpair(int []); #endif