proto-bonding: Modify ipaddr as optional

The configuration of ipaddr in proto-bonding is not necessary,
such as adding the bond interface to the bridge or
performing pppoe dialing on the bond interface, etc.

Signed-off-by: Findlay Feng <i@fengch.me>
This commit is contained in:
Findlay Feng 2024-02-27 15:34:24 +08:00 committed by 冯诚
parent ccabe6d8e6
commit 7da6cb31d1
No known key found for this signature in database
GPG Key ID: 8C75F1E511B5EA57
1 changed files with 2 additions and 9 deletions

View File

@ -193,15 +193,8 @@ proto_bonding_setup() {
proto_init_update "$link" 1
# For static configuration we _MUST_ have an IP address
[ -z "$ipaddr" ] && {
echo "$cfg" "No local IP address defined"
proto_notify_error "$cfg" INVALID_LOCAL_ADDRESS
proto_block_restart "$cfg"
return
}
proto_add_ipv4_address "$ipaddr" "$netmask"
# If ipaddr is configured, configure the ip to the interface
[ -n "$ipaddr" ] && proto_add_ipv4_address "$ipaddr" "$netmask"
proto_send_update "$cfg"
}