Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dhclient]Fix dhclient-hook inband-ztp permission errors. #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/usr/lib/ztp/dhcp/inband-ztp-ip
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ case $reason in
if inband_interface_check ${interface} ; then
if [ -n "$old_ip_address" ] && [ -n "$old_subnet_mask" ]; then
prefix=$(IPprefix_by_netmask "${old_subnet_mask}")
config interface ip remove ${interface} ${old_ip_address}${prefix}
sudo config interface ip remove ${interface} ${old_ip_address}${prefix}
fi
fi
;;
Expand All @@ -47,11 +47,11 @@ case $reason in
if [ -n "$new_ip_address" ] && [ -n "$new_subnet_mask" ]; then
if [ -n "$old_ip_address" ] && [ -n "$old_subnet_mask" ]; then
prefix=$(IPprefix_by_netmask "${old_subnet_mask}")
config interface ip remove ${interface} ${old_ip_address}${prefix}
sudo config interface ip remove ${interface} ${old_ip_address}${prefix}
fi
prefix=$(IPprefix_by_netmask "${new_subnet_mask}")
if [ "${prefix}" != "/0" ]; then
config interface ip add ${interface} ${new_ip_address}${prefix}
sudo config interface ip add ${interface} ${new_ip_address}${prefix}
fi
fi
fi
Expand Down
6 changes: 3 additions & 3 deletions src/usr/lib/ztp/dhcp/inband-ztp-ip6
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ case $reason in
else
old_prefixlen=128
fi
config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen}
sudo config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen}
fi
fi
;;
Expand All @@ -45,14 +45,14 @@ case $reason in
else
old_prefixlen=128
fi
config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen}
sudo config interface ip remove ${interface} ${old_ip6_address}/${old_prefixlen}
fi
if [ -n "${new_ip6_prefixlen}" ]; then
prefixlen=${new_ip6_prefixlen}
else
prefixlen=128
fi
config interface ip add ${interface} ${new_ip6_address}/${new_ip6_prefixlen}
sudo config interface ip add ${interface} ${new_ip6_address}/${new_ip6_prefixlen}
fi
fi
;;
Expand Down