Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <seccomp.h>
- #include <linux/net.h>
- #include <linux/in.h>
- #include <linux/in6.h>
- #include <linux/udp.h>
- #include <errno.h>
- int main() {
- scmp_filter_ctx ctx;
- ctx = seccomp_init(SCMP_ACT_ALLOW);
- // Block UDP-Lite socket creation
- seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM),
- SCMP_SYS(socket), 1,
- SCMP_A2(SCMP_CMP_EQ, IPPROTO_UDPLITE));
- seccomp_load(ctx);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment