- 1216
- 1217 case SO_TXTIME:
- 1218 if (optlen != sizeof(struct sock_txtime)) {
- 1219 ret = -EINVAL;
- 1220 break;
- 1221 } else if (copy_from_sockptr(&sk_txtime, optval,
- 1222 sizeof(struct sock_txtime))) {
- 1223 ret = -EFAULT;
- 1224 break;
- 1225 } else if (sk_txtime.flags & ~SOF_TXTIME_FLAGS_MASK) {
- 1226 ret = -EINVAL;
- 1227 break;
- 1228 }
- 1229 /* CLOCK_MONOTONIC is only used by sch_fq, and this packet
- 1230 * scheduler has enough safe guards.
- 1231 */
- 1232 if (sk_txtime.clockid != CLOCK_MONOTONIC &&
- 1233 !ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) {
- 1234 ret = -EPERM;
- 1235 break;
- 1236 }
- 1237 sock_valbool_flag(sk, SOCK_TXTIME, true);
- 1238 sk->sk_clockid = sk_txtime.clockid;
- 1239 sk->sk_txtime_deadline_mode =
- 1240 !!(sk_txtime.flags & SOF_TXTIME_DEADLINE_MODE);
linux SO_TXTIME ./net/core/sock.c
Posted by Anonymous on Tue 28th Sep 2021 11:11
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.