mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 22:10:14 +01:00
platform: drop detecting address scope in _nl_msg_new_address()
All callers explicitly set a scope, like they should. Drop guessing the scope. Also, use the proper integer type.
This commit is contained in:
parent
45ca7dfaf3
commit
52c8ee2c9d
1 changed files with 2 additions and 10 deletions
|
|
@ -4780,7 +4780,7 @@ _nl_msg_new_address(uint16_t nlmsg_type,
|
|||
guint8 plen,
|
||||
gconstpointer peer_address,
|
||||
guint32 flags,
|
||||
int scope,
|
||||
guint8 scope,
|
||||
guint32 lifetime,
|
||||
guint32 preferred,
|
||||
in_addr_t ip4_broadcast_address,
|
||||
|
|
@ -4792,6 +4792,7 @@ _nl_msg_new_address(uint16_t nlmsg_type,
|
|||
.ifa_index = ifindex,
|
||||
.ifa_prefixlen = plen,
|
||||
.ifa_flags = flags,
|
||||
.ifa_scope = scope,
|
||||
};
|
||||
gsize addr_len;
|
||||
|
||||
|
|
@ -4800,15 +4801,6 @@ _nl_msg_new_address(uint16_t nlmsg_type,
|
|||
|
||||
msg = nlmsg_alloc_simple(nlmsg_type, nlmsg_flags);
|
||||
|
||||
if (scope == -1) {
|
||||
/* Allow having scope unset, and detect the scope (including IPv4 compatibility hack). */
|
||||
if (family == AF_INET && address && *((char *) address) == 127)
|
||||
scope = RT_SCOPE_HOST;
|
||||
else
|
||||
scope = RT_SCOPE_UNIVERSE;
|
||||
}
|
||||
am.ifa_scope = scope,
|
||||
|
||||
addr_len = family == AF_INET ? sizeof(in_addr_t) : sizeof(struct in6_addr);
|
||||
|
||||
if (nlmsg_append_struct(msg, &am) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue