aboutsummaryrefslogtreecommitdiff
path: root/package/network/services/lldpd/files/lldpd.init
Commit message (Collapse)AuthorAge
* lldpd: fix reload bug: advertisements shall default to onPaul Donald2024-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Because these capability advertisements default to on in lldpd, they became absent at reload, and not restart, due to how the reload logic works ( keep daemon running, send unconfigured and then the new config via socket ), and it was not evident unless you happened to be looking for it (e.g. via pcap or tcpdump). It was also not evident from the manpage ( have now sent patches upstream ). At reload time, the unconfigure logic disabled them unless they were explicitly enabled (compare with other settings where 'unconfigure' just resets them). Now they default to on/enabled at init time, and are explicitly 'unconfigure'd at startup if the user disables them via: lldp_mgmt_addr_advertisements=0 lldp_capability_advertisements=0 In other words: explicit is necessary to disable the advertisements. The same applies to 'configure system capabilities enabled'. Technically 'unconfigure'd is the default but now it is explicit at reload. Tested on: 23.05.3 Signed-off-by: Paul Donald <newtwen+github@gmail.com>
* lldpd: extended interface(s) parsing to handle patternsPaul Donald2024-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For interface type parameters, the man page documents patterns: ``` *,!eth*,!!eth1 uses all interfaces, except interfaces starting with "eth", but including "eth1". ``` * Renamed `_ifname` to `_l2dev`. * get the l2dev via network_get_physdev (and not l3dev) * Glob pattern `*` is also valid - use noglob for this The net result is that now interface 'names' including globs '*' and '!' inversions are included in the generated lldpd configs. Temporarily `set -o noglob` and then `set +o noglob` to disable & enable globbing respectively, because when we pass `*` as an interface choice, other file and pathnames get sucked in from where the init script runs, and the `*` never makes it to lldpd. Tested extensively on: 22.03.6, 23.05.3 Signed-off-by: Paul Donald <newtwen+github@gmail.com> [ squash with commit bumping release version ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* lldpd: make management address advertisement controllablePaul Donald2024-04-12
| | | | | | | | | | Defaults to off. Available from >= 0.7.15 These are sent in TLV Signed-off-by: Paul Donald <newtwen+github@gmail.com>
* lldpd: make capabilities advertisement controllablePaul Donald2024-04-12
| | | | | | | | | | Defaults to off. Only available from >= 1.0.15 These capabilities are sent in TLV. Signed-off-by: Paul Donald <newtwen+github@gmail.com>
* lldpd: note about capabilitiesPaul Donald2024-04-12
| | | | | | | | | only available from >= 1.0.15 Comments are useful. Apparently this config parameter was committed when openwrt used an older version of lldpd which did not yet support it. Signed-off-by: Paul Donald <newtwen+github@gmail.com>
* lldpd: fix restartPaul Donald2024-04-12
| | | | | | | | | | | | | | | | | | | Redirection broke in 5364fe0f01ca ("lldpd: shellcheck fixes") redirects to /dev/null shall be handled correctly (i.e. last). This fixes these errors on `/etc/init.d/lldpd reload`: 2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null` 2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null` 2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null` 2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null` Tested-on: 22.03.6 Fixes: 5364fe0f01ca ("lldpd: shellcheck fixes") Signed-off-by: Paul Donald <newtwen+github@gmail.com> [ improve commit description, add fixes tag ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* lldpd: shellcheck fixesPaul Donald2024-03-12
| | | | | | | | No functionality/behaviour changes; code is synonymous Tested on: 22.03.6 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: implement lldp_policy parameterPaul Donald2024-03-12
| | | | | | | | | | | | | | For certain lldp_class scenarios (2 & 3) a policy must be set also. Class 4 is default, although it's good to handle the policy eventuality. Here, set a default lldp_policy for all lldp_class scenarios. Any lldp_policy can now be set. Depends on PR #14584 (which introduced an `if` block) Tested on 22.03.5, 22.03.6 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: Implement location parameterPaul Donald2024-03-11
| | | | | | | | | | | | | | | | | Previously only partially implemented. After commit 5007f488bb5e1b556052ef246bd3822fed8d09d2 lldp_location was never removed Now, add the value of lldp_location to the generated config. The location param has a few syntaxes, so the config acquires the first usage from the man page: 'address country EU' Supplementary fix for PR #14193 (this param was included in the original PR #13018 but the lldp_location fixes were absent from PR #14193). Tested on 22.03.5, 22.03.6 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: fix error "sh: XXXms: bad number"Paul Donald2024-03-11
| | | | | | | | | | | | from commit 3ce909914a12647bec52bcee0a162dd6d158a4f6 The lldpd man page says that "configure lldp tx-interval" can specify an interval value in milliseconds by appending a "ms" suffix to the figure. Thus mandating string handling, and not integer comparison. Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: refactor out ifaces derivation; reuse functionPaul Donald2024-03-11
| | | | | | | | | | | | | | | from commit 909f0630663d7ae1471c76154516e3299992a150 Now pass two params to get_config_cid_ifaces() for: cid_interface interface Each of which is a CSV of interfaces. Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: remove unneeded quotesPaul Donald2024-03-11
| | | | | | | | from commit a5f715da713304972467612d6934130ce3aa2837 Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: remove unneeded quotes and variable quotingPaul Donald2024-03-11
| | | | | | | | | | | | | | | | | | | | from commit ac771313ebedd2c4bfda8adef47650d45d77c32d portidsubtype takes 1 of 2 possible keywords which do not need quoting: configure lldp portidsubtype ifname | macaddress The third keyword 'local' is used in the syntax when individual ports are being defined: configure [ports ethX [,…]] lldp portidsubtype local value When this syntax is used, quoting is useful (see test cases for lldpd). In the init file, the 'local' syntax is unused. Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: remove unneeded quotes and variable quotingPaul Donald2024-03-11
| | | | | | | | | | | | | from commit c98ee4dbb3db0f064d990941cdd82e872da76946 agent-type takes 1 of 3 possible keywords which do not require quoting: configure lldp agent-type nearest-bridge | nearest-non-tpmr-bridge | nearest-customer-bridge Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: remove unneeded quotes and variable quotingPaul Donald2024-03-11
| | | | | | | | | | from commit 3ce909914a12647bec52bcee0a162dd6d158a4f6 'capabilities enabled x' where x is a string of CSV Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: remove unneeded quotesPaul Donald2024-03-11
| | | | | | | | from commit 3ce909914a12647bec52bcee0a162dd6d158a4f6 Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: remove unneeded quotes and variable quotingPaul Donald2024-03-11
| | | | | | | | from commit 24176a6bdd8f26040a97960868fd0d9ee968d695 Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: fix a paste errorPaul Donald2024-03-11
| | | | | | | | | | from commit 1be2088a5247b2cfabe8be991c1e52ddaf780a16 The original PR #13018 did not exhibit this. Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: spell fixesPaul Donald2024-03-11
| | | | | | | | Supplementary fix for PR #14193 Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: fix -k 'lldp_no_version' rowPaul Donald2024-03-11
| | | | | | | | | Supplementary fix for PR #14193 and commit b67182008fd124706be0ec3ce67347447554ffd5 Tested on 22.03.5 Signed-off-by: Paul Donald <newtwen@gmail.com>
* lldpd: add option to force EDPStephen Howell2024-02-08
| | | | | | allow EDP support if compiled and add force EDP option Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: only use snmp options when compiled inStephen Howell2024-02-08
| | | | | | prevent SNMP options being passed unless lldpd supports them Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add option for tx delay and tx holdStephen Howell2024-02-08
| | | | | | add option to set LLDP transmit delay, hold timers to set update frequency Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add option to set system platformStephen Howell2024-02-08
| | | | | | add option to override system platform instead of using kernel name Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add option to force SONMP enabledStephen Howell2024-02-08
| | | | | | add option to force SONMP to be enabled even when no peer detected Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add option to force FDP onStephen Howell2024-02-08
| | | | | | add option to force FDP when no peers detected Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: set CDP version and allow forcing CDP onStephen Howell2024-02-08
| | | | | | add option to specify CDPv1 or CDPv2 and separately enable or force each Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: allow disabling LLDP protcolStephen Howell2024-02-08
| | | | | | add option to allow LLDP disabling while using other supported protocols Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add portidsubtype optionStephen Howell2024-02-08
| | | | | | add option portidsubtype to correct port identifiers and descriptions Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add agent-type optionStephen Howell2024-02-08
| | | | | | add option to set agent-type to control propogation Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add LLDP MED optionsStephen Howell2024-02-08
| | | | | | add option to enable LLDP MED fast-start and set fast-start timer Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: option to disable LLDP-MED inventory TLVStephen Howell2024-02-08
| | | | | | add option to disable LLDP-MED inventory TLV transmission Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: Init adds no-version optionStephen Howell2024-02-08
| | | | | | add option to disable advertising kernel version Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: Allow neighbour filteringStephen Howell2024-02-08
| | | | | | add filter option to init script. Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: LLDPD binds to only specified interfacesStephen Howell2024-02-08
| | | | | | | Bind to the configured system interfaces only. Switchport interfaces are no longer ignored and uci interface values for LLDPD are honored. Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: Init config read on reloadStephen Howell2024-02-08
| | | | | | | | | Init script reload with trigger to detect config file update. Reload command added to attempt non-impactful lldpd reload where lldpcli can be used to update config without process restart. Config hash function used to track whether process restart is needed. Signed-off-by: Stephen Howell <howels@allthatwemight.be>
* lldpd: add lldp_syscapabilities config optionSebastian Pflieger2023-09-24
| | | | | | | allow to overwrite the detected system capabilities e.g. if devices does not operate as bridge. Signed-off-by: Sebastian Pflieger <sebastian@pflieger.email>
* lldpd: add reload triggerStijn Tintel2021-11-14
| | | | | | | This is needed to reload the service when calling reload_config, if the UCI config has changed. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* lldpd: consolidate procd command linesStijn Tintel2021-11-14
| | | | | | There is no need to have multiple lines for this. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* lldpd: add management IP settingDaniel A. Maierhofer2020-05-08
| | | | | | | | | | | | | add option to set management IP pattern also add missing 'unconfigure system hostname' for example pattern '!192.168.1.1' makes it possible that WAN IP is selected instead of LAN IP Signed-off-by: Daniel A. Maierhofer <git@damadmai.at> [grammar and spelling fixes in commit message] Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* netifd,lldpd,rpcd,log: use generic service_runningPetr Štetiar2019-09-15
| | | | | | | | | | | | | | | | | | commit eb204d14f75c ("base-files: implement generic service_running") introduced generic service_running so it's not needed to copy&paste same 3 lines over and over again. I've removed service_running from netifd/network init script as well, because it was not working properly, looked quite strange and I didn't understand the intention: $ /etc/init.d/network stop $ service network running && echo "yes" || echo "nope" ( have to wait for 30s ) Command failed: Request timed out yes Signed-off-by: Petr Štetiar <ynezz@true.cz>
* lldpd: add option to edit hostnameLucian Cristian2019-05-11
| | | | | | | also fixes the annoying repeating syslog lldp[]: unable to get system name Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
* merge: packages: update branding in core packagesZoltan HERPAI2017-12-08
| | | | Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
* lldpd: drop specific respawn params [use system-wide]Alexandru Ardelean2017-05-18
| | | | | | | I think I added these respawn params [a while back], when I did the conversion to procd init script format. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* lldpd: add Net-SNMP AgentX supportStijn Tintel2017-01-10
| | | | | | | Enabling this makes it possible to query LLDP neighbors via SNMP. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Acked-by: Jo-Philipp Wich <jo@mein.io>
* lldpd: freeze execution of lldpd during reloadAlexandru Ardelean2016-10-31
| | | | | | | | | | During reload, we could send invalid information to the other side and confuse it. That's why, during reload we'll pause execution, do the reconfig and resume + update when reload is done. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* lldpd: fix reload function for when interfaces changeAlexandru Ardelean2016-10-31
| | | | | | | | | | | | | | | | The problem is that interfaces are specified at start as command line arguments, making them unchange-able via reload. That means, we have to move (since lldpd allows this) the interfaces-match-pattern option to be in a config file and reload the configuration. It's either that, or do a 'restart'. Since we're generating the lldpd.conf file, we'll have to move the 'sysconfdir' of lldpd to /tmp, where the files will get written ; this will prevent any unncessary flash writes. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* lldpd: Use /etc/os-release instead of /etc/openwrt_*Daniel Dickinson2016-06-27
| | | | | | | | | With the addition of /etc/os-release patching lldpd to use /etc/openwrt_release and to have the initscript use /etc/openwrt_release and/or /etc/openwrt_version becomes unnecessary. Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
* branding: add LEDE brandingJohn Crispin2016-03-24
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* lldpd: add STOP=01 param in init scriptFelix Fietkau2015-12-05
| | | | | | | | | | This should ensure that lldpd is among the first processes to stop, so that it has time to send the shutdown LLDPU to the other side, before the network goes down. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> SVN-Revision: 47786