MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rt_maskedcopy

Function rt_maskedcopy

freebsd/net/route.c:670–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668#endif
669
670void
671rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr *netmask)
672{
673 u_char *cp1 = (u_char *)src;
674 u_char *cp2 = (u_char *)dst;
675 u_char *cp3 = (u_char *)netmask;
676 u_char *cplim = cp2 + *cp3;
677 u_char *cplim2 = cp2 + *cp1;
678
679 *cp2++ = *cp1++; *cp2++ = *cp1++; /* copies sa_len & sa_family */
680 cp3 += 2;
681 if (cplim > cplim2)
682 cplim = cplim2;
683 while (cp2 < cplim)
684 *cp2++ = *cp1++ & *cp3++;
685 if (cp2 < cplim2)
686 bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));
687}
688
689/*
690 * Announce interface address arrival/withdraw

Callers 5

handle_rtm_getFunction · 0.85
create_rtentryFunction · 0.85
rib_del_routeFunction · 0.85
handle_rtm_getFunction · 0.85
ff_rtioctl_oldFunction · 0.85

Calls 1

bzeroFunction · 0.85

Tested by

no test coverage detected