]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a sandbox rule to allow IP_TRANSPARENT
authorNick Mathewson <nickm@torproject.org>
Sun, 2 Feb 2014 20:47:48 +0000 (15:47 -0500)
committerNick Mathewson <nickm@torproject.org>
Sun, 2 Feb 2014 20:47:48 +0000 (15:47 -0500)
src/common/sandbox.c

index dec6bfeea50ed54bf771c272b2d4655e6fcf6d6e..6b78748834e01d1d21bb5c1376cf89ef5747d492 100644 (file)
@@ -475,6 +475,14 @@ sb_setsockopt(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
   if (rc)
     return rc;
 
+#ifdef IP_TRANSPARENT
+  rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), 2,
+      SCMP_CMP(1, SCMP_CMP_EQ, SOL_IP),
+      SCMP_CMP(2, SCMP_CMP_EQ, IP_TRANSPARENT));
+  if (rc)
+    return rc;
+#endif
+
   return 0;
 }