mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 13:06:51 +00:00
Merge pull request #7136 from donaldsharp/freebsd_ifc_issue
zebra: Allow FreeBSD to set and delete addresses from an interface
This commit is contained in:
commit
1af665fda0
@ -865,6 +865,7 @@ int ifam_read(struct ifa_msghdr *ifam)
|
|||||||
{
|
{
|
||||||
struct interface *ifp = NULL;
|
struct interface *ifp = NULL;
|
||||||
union sockunion addr, mask, brd;
|
union sockunion addr, mask, brd;
|
||||||
|
bool dest_same = false;
|
||||||
char ifname[INTERFACE_NAMSIZ];
|
char ifname[INTERFACE_NAMSIZ];
|
||||||
short ifnlen = 0;
|
short ifnlen = 0;
|
||||||
char isalias = 0;
|
char isalias = 0;
|
||||||
@ -891,6 +892,10 @@ int ifam_read(struct ifa_msghdr *ifam)
|
|||||||
rely upon the interface type. */
|
rely upon the interface type. */
|
||||||
if (if_is_pointopoint(ifp))
|
if (if_is_pointopoint(ifp))
|
||||||
SET_FLAG(flags, ZEBRA_IFA_PEER);
|
SET_FLAG(flags, ZEBRA_IFA_PEER);
|
||||||
|
else {
|
||||||
|
if (memcmp(&addr, &brd, sizeof(addr)) == 0)
|
||||||
|
dest_same = true;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* it might seem cute to grab the interface metric here, however
|
/* it might seem cute to grab the interface metric here, however
|
||||||
@ -907,13 +912,14 @@ int ifam_read(struct ifa_msghdr *ifam)
|
|||||||
if (ifam->ifam_type == RTM_NEWADDR)
|
if (ifam->ifam_type == RTM_NEWADDR)
|
||||||
connected_add_ipv4(ifp, flags, &addr.sin.sin_addr,
|
connected_add_ipv4(ifp, flags, &addr.sin.sin_addr,
|
||||||
ip_masklen(mask.sin.sin_addr),
|
ip_masklen(mask.sin.sin_addr),
|
||||||
&brd.sin.sin_addr,
|
dest_same ? NULL : &brd.sin.sin_addr,
|
||||||
(isalias ? ifname : NULL),
|
(isalias ? ifname : NULL),
|
||||||
METRIC_MAX);
|
METRIC_MAX);
|
||||||
else
|
else
|
||||||
connected_delete_ipv4(ifp, flags, &addr.sin.sin_addr,
|
connected_delete_ipv4(ifp, flags, &addr.sin.sin_addr,
|
||||||
ip_masklen(mask.sin.sin_addr),
|
ip_masklen(mask.sin.sin_addr),
|
||||||
&brd.sin.sin_addr);
|
dest_same ? NULL
|
||||||
|
: &brd.sin.sin_addr);
|
||||||
break;
|
break;
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
/* Unset interface index from link-local address when IPv6 stack
|
/* Unset interface index from link-local address when IPv6 stack
|
||||||
|
Loading…
Reference in New Issue
Block a user