Skip to content
Merged

Misc #957

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
26 changes: 0 additions & 26 deletions board/common/rootfs/etc/avahi/avahi-autoipd.action
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,20 @@
# $3 IP adddress

PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin"
NAME="/etc/frr/static.d/$2-zeroconf.conf"
NEXT="${NAME}+"

log()
{
logger -I $$ -t zeroconf -p user.notice "$*"
}

# Reduce changes needed by comparing with previous route(s)
act()
{
case $1 in
add)
echo "! Generated by avahi-autoipd" > "$NEXT"
echo "ip route 0.0.0.0/0 $2 254" >> "$NEXT"
cmp -s "$NAME" "$NEXT" && return
mv "$NEXT" "$NAME"
;;
del)
[ -f "$NAME" ] || return
rm "$NAME"
;;
*)
return
;;
esac

initctl -nbq restart staticd
}

case "$1" in
BIND)
ip addr flush dev "$2" proto random
ip addr add "$3"/16 brd 169.254.255.255 scope link dev "$2" proto random
act add "$2"
log "set ipv4ll $3 on iface $2"
;;

CONFLICT|UNBIND|STOP)
act del "$2"
ip addr flush dev "$2" proto random
log "clr ipv4ll on iface $2"
;;
Expand Down
6 changes: 5 additions & 1 deletion doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ All notable changes to the project are documented in this file.
- YANG type for SSH private/public keys has changed, from
ietf-crypto-types to infix-crypto-types
- Add support for link aggregation (lag), static (balance-xor) and LACP
- Drop automatic default route (interface route) for IPv4 autoconf, not
necessary and causes more confusion than good. Issue #923

### Fixes
- N/A
- Fix #956: CLI `copy` command complains it cannot change owner when
copying `factory-config` to `running-config`. Bogus error, the
latter is not really a file


[v25.01.0][] - 2025-01-31
Expand Down
5 changes: 4 additions & 1 deletion src/bin/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ static void set_owner(const char *fn, const char *user)
{
struct passwd *pw;

if (!fn)
return; /* not an error, e.g., running-config is not a file */

pw = getpwnam(user);
if (pw && !chmod(fn, 0660) && !chown(fn, pw->pw_uid, pw->pw_gid))
return;

fprintf(stderr, ERRMSG "setting owner %s on %s: %s\n", fn, user, strerror(errno));
fprintf(stderr, ERRMSG "setting owner %s on %s: %s\n", user, fn, strerror(errno));
}

static const char *infix_ds(const char *text, struct infix_ds **ds)
Expand Down