From f252a38d977d319f05df29f0f756ba0d1062eb39 Mon Sep 17 00:00:00 2001 From: Manevolent Date: Wed, 12 Apr 2023 22:41:29 -0600 Subject: [PATCH] Update subnet-up.tmpl --- tinc/subnet-up.tmpl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tinc/subnet-up.tmpl b/tinc/subnet-up.tmpl index c499901..41a52bf 100644 --- a/tinc/subnet-up.tmpl +++ b/tinc/subnet-up.tmpl @@ -6,11 +6,13 @@ if [ -z "\$nonMACChars" ]; then # This subnet is a MAC echo "\$SUBNET" > \$macFile else - # This subnet is likely an IP address, add it to the ARP table - if test -f "\$macFile"; then - mac=`cat \$macFile` - arp -s "\$SUBNET" "\$mac" - else - echo "[WARNING] No MAC known for node \$NODE, can't route \$SUBNET. This is only a problem if this is a remote route." + if echo "\$SUBNET" | grep -q -E ".+/32$"; then + # This subnet is likely an IP address, add it to the ARP table + if test -f "\$macFile"; then + mac=`cat \$macFile` + arp -s "\$SUBNET" "\$mac" + else + echo "[WARNING] No MAC known for node \$NODE, can't route \$SUBNET. This is only a problem if this is a remote route." + fi fi fi