Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170804343
D59267.id185936.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D59267.id185936.diff
View Options
diff --git a/sysutils/Makefile b/sysutils/Makefile
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -220,6 +220,7 @@
SUBDIR += cmockery2
SUBDIR += cmogstored
SUBDIR += cmospwd
+ SUBDIR += cni-dnsname
SUBDIR += colorize
SUBDIR += conan
SUBDIR += confctl
diff --git a/sysutils/cni-dnsname/Makefile b/sysutils/cni-dnsname/Makefile
new file mode 100644
--- /dev/null
+++ b/sysutils/cni-dnsname/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= cni-dnsname
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.3.1
+CATEGORIES= sysutils
+
+MAINTAINER= adrian@FreeBSD.org
+COMMENT= DNS name resolution for containers (CNI plugin)
+WWW= https://github.com/containers/dnsname
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS= dnsmasq:dns/dnsmasq
+
+USES= go:modules
+GO_MODULE= github.com/containers/dnsname
+GO_TARGET= ./plugins/meta/dnsname
+
+PLIST_FILES= libexec/cni/dnsname
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/cni
+ ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/dnsname ${STAGEDIR}${PREFIX}/libexec/cni
+
+.include <bsd.port.mk>
diff --git a/sysutils/cni-dnsname/distinfo b/sysutils/cni-dnsname/distinfo
new file mode 100644
--- /dev/null
+++ b/sysutils/cni-dnsname/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1788626014
+SHA256 (go/sysutils_cni-dnsname/cni-dnsname-v1.3.1/v1.3.1.mod) = 3aaae02131f6f6967e665ba2f0c56a051c6e62b28d29c6779593b3e0d4eaf201
+SIZE (go/sysutils_cni-dnsname/cni-dnsname-v1.3.1/v1.3.1.mod) = 407
+SHA256 (go/sysutils_cni-dnsname/cni-dnsname-v1.3.1/v1.3.1.zip) = 7a9ba4ed651dc2a9516614c24df148cfef64f11c7628ea91321c651a01261441
+SIZE (go/sysutils_cni-dnsname/cni-dnsname-v1.3.1/v1.3.1.zip) = 32026
diff --git a/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_config.go b/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_config.go
new file mode 100644
--- /dev/null
+++ b/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_config.go
@@ -0,0 +1,11 @@
+--- plugins/meta/dnsname/config.go.orig 1979-11-30 00:00:00 UTC
++++ plugins/meta/dnsname/config.go
+@@ -25,7 +25,7 @@ pid-file={{.PidFile}}
+ domain={{.Domain}}
+ expand-hosts
+ pid-file={{.PidFile}}
+-except-interface=lo
++except-interface=lo0
+ bind-dynamic
+ no-hosts
+ interface={{.NetworkInterface}}
diff --git a/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_files.go b/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_files.go
new file mode 100644
--- /dev/null
+++ b/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_files.go
@@ -0,0 +1,28 @@
+--- plugins/meta/dnsname/files.go.orig 2025-12-28 12:10:39 UTC
++++ plugins/meta/dnsname/files.go
+@@ -54,18 +54,14 @@ func checkForDNSMasqConfFile(conf dnsNameFile) error {
+ if err != nil {
+ return err
+ }
++ // FreeBSD uses pf, not iptables - skip firewall rule setup
++ // The host's pf should already allow local DNS traffic
+ ip, err := iptables.New()
+- if err != nil {
+- return err
+- }
+- args := []string{"-i", conf.NetworkInterface, "-p", "udp", "-m", "udp", "--dport", "53", "-j", "ACCEPT"}
+- exists, err := ip.Exists("filter", "INPUT", args...)
+- if err != nil {
+- return err
+- }
+- if !exists {
+- if err := ip.Insert("filter", "INPUT", 1, args...); err != nil {
+- return err
++ if err == nil {
++ args := []string{"-i", conf.NetworkInterface, "-p", "udp", "-m", "udp", "--dport", "53", "-j", "ACCEPT"}
++ exists, _ := ip.Exists("filter", "INPUT", args...)
++ if !exists {
++ _ = ip.Insert("filter", "INPUT", 1, args...)
+ }
+ }
+ // Generate the template and compile it.
diff --git a/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_files__test.go b/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_files__test.go
new file mode 100644
--- /dev/null
+++ b/sysutils/cni-dnsname/files/patch-plugins_meta_dnsname_files__test.go
@@ -0,0 +1,11 @@
+--- plugins/meta/dnsname/files_test.go.orig 1979-11-30 00:00:00 UTC
++++ plugins/meta/dnsname/files_test.go
+@@ -14,7 +14,7 @@ pid-file=/run/containers/cni/dnsname/cni0/pidfile
+ domain=foobar.org
+ expand-hosts
+ pid-file=/run/containers/cni/dnsname/cni0/pidfile
+-except-interface=lo
++except-interface=lo0
+ bind-dynamic
+ no-hosts
+ interface=cni0
diff --git a/sysutils/cni-dnsname/pkg-descr b/sysutils/cni-dnsname/pkg-descr
new file mode 100644
--- /dev/null
+++ b/sysutils/cni-dnsname/pkg-descr
@@ -0,0 +1,6 @@
+dnsname is a CNI plugin that provides name resolution for containers
+within a CNI network using dnsmasq. When enabled, containers on the
+same network can resolve each other using their container names.
+
+This plugin is primarily used by Podman to provide DNS resolution for
+containers when using the CNI networking backend (e.g., on FreeBSD).
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 7, 6:02 PM (14 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38479399
Default Alt Text
D59267.id185936.diff (4 KB)
Attached To
Mode
D59267: name: add cni-dnsname
Attached
Detach File
Event Timeline
Log In to Comment