diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-01-19 14:51:34 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-01-22 12:14:59 -0500 | 
| commit | a0d38a7ac61ba122e3821fc05a0e7ae98a6cd4a9 (patch) | |
| tree | 9924b9d686d5dad46f816ccc109cebbdfe04dbdd /zebra/rt_netlink.c | |
| parent | 275edb5c160a384043e2ad3d8e3eebe709c60bd1 (diff) | |
lib, nhrpd: Move neighbor reg/unreg to lib/zclient.c
This is needed to be generic.  Let's make it so.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/rt_netlink.c')
| -rw-r--r-- | zebra/rt_netlink.c | 24 | 
1 files changed, 11 insertions, 13 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 711ceae6d6..f092fc5c85 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -4256,20 +4256,18 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)  		/* copy LLADDR information */  		l2_len = RTA_PAYLOAD(tb[NDA_LLADDR]);  	} -	if (l2_len == IPV4_MAX_BYTELEN || l2_len == 0) { -		union sockunion link_layer_ipv4; -		if (l2_len) { -			sockunion_family(&link_layer_ipv4) = AF_INET; -			memcpy((void *)sockunion_get_addr(&link_layer_ipv4), -			       RTA_DATA(tb[NDA_LLADDR]), l2_len); -		} else -			sockunion_family(&link_layer_ipv4) = AF_UNSPEC; -		zsend_neighbor_notify(cmd, ifp, &ip, -				      netlink_nbr_entry_state_to_zclient( -					      ndm->ndm_state), -				      &link_layer_ipv4); -	} +	union sockunion link_layer_ipv4; + +	if (l2_len) { +		sockunion_family(&link_layer_ipv4) = AF_INET; +		memcpy((void *)sockunion_get_addr(&link_layer_ipv4), +		       RTA_DATA(tb[NDA_LLADDR]), l2_len); +	} else +		sockunion_family(&link_layer_ipv4) = AF_UNSPEC; +	zsend_neighbor_notify(cmd, ifp, &ip, +			      netlink_nbr_entry_state_to_zclient(ndm->ndm_state), +			      &link_layer_ipv4, l2_len);  	if (h->nlmsg_type == RTM_GETNEIGH)  		return 0;  | 
