luci: luci-mod-network: Can't configure second GRE tunnel

Steps to reproduce:

  1. Create a GRE interface in Network → Interfaces named gre
  2. Attempt to create a second GRE tunnel with a different name

Actual behavior:

Lucy throws an error in the device selector: image

Expected behavior:

The GRE tunnel is created.

Additional Information:

OpenWrt version information from system /etc/openwrt_release

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='11' #my versioning based on master
DISTRIB_REVISION='r26386-1188cae092'
DISTRIB_TARGET='ath79/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='OpenWrt 11 r26386-1188cae092'
DISTRIB_TAINTS='no-all'

If the tunnel is created directly in UCI it works and shows up in LuCI correctly

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (27 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @dannil , sorry I haven’t been able to test yet, I will test it this week, as soon as I can I’ll give some feedback, thanks for the awesome work!

Or go to that commit and replace your on-device interfaces.js with that interfaces.js. Clear browser cache and retry.

Ah, of course. Like wireguard_wg0. Doesn’t leave us with much space. I think the 15 characters isn’t a total length limit tho. I have some configs which are 24 characters long with e.g. wireguard_blah_blah_blah.

Seems to be for convenience. If you see a trivial fix, like anchoring on additional conditions, we’re open to suggestions.

I took at look at this problem and the reason is at least simple; the protocol validate functionality reuses the name validate functionality, which means that if you create the first GRE tunnel with name gre, when creating the second one, uci.get('network', 'gre') will not return null, causing the red tooltip to appear for the protocol.

This affects every case where the name of the first interface collides with the protocol name of the second interface, I just tried DHCPv6 as an example.

Screenshot_10 Screenshot_8

@jow- is there a special reason why it reuses it one-to-one as implemented in e4bc192012b05078eb7675e42908e0dd9d04ee88 or was it just for convenience sake? The protocol is a list value so I assume that we won’t need the too long of an interface name either. This is a corner case of course, since you could just name the interface something else, but it’s not obvious to the user what the actual issue is.