local address="$1"
local mask="$2"
local broadcast="$3"
+ local ptp="$4"
- jshn_append PROTO_IPADDR "$address/$mask/$broadcast"
+ jshn_append PROTO_IPADDR "$address/$mask/$broadcast/$ptp"
}
proto_add_ipv6_address() {
_proto_push_ipv4_addr() {
local str="$1"
- local address mask broadcast
+ local address mask broadcast ptp
address="${str%%/*}"
str="${str#*/}"
mask="${str%%/*}"
str="${str#*/}"
- broadcast="$str"
+ broadcast="${str%%/*}"
+ str="${str#*/}"
+ ptp="$str"
json_add_object ""
json_add_string ipaddr "$address"
[ -n "$mask" ] && json_add_string mask "$mask"
[ -n "$broadcast" ] && json_add_string broadcast "$broadcast"
+ [ -n "$ptp" ] && json_add_string ptp "$ptp"
json_close_object
}
local interface="$1"
local host="$2"
+ # execute in subshell to not taint callers env
+ # see tickets #11046, #11545, #11570
+ (
+ json_init
+ json_add_int action 6
+ json_add_string host "$host"
+ _proto_notify "$interface" -S
+ )
+}
+
+proto_setup_failed() {
+ local interface="$1"
json_init
- json_add_int action 6
- json_add_string host "$host"
- _proto_notify "$interface" -S
+ json_add_int action 7
+ _proto_notify "$interface"
}
init_proto() {