MCPcopy Index your code
hub / github.com/git/git / addrcmp

Function addrcmp

daemon.c:795–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795static int addrcmp(const struct sockaddr_storage *s1,
796 const struct sockaddr_storage *s2)
797{
798 const struct sockaddr *sa1 = (const struct sockaddr*) s1;
799 const struct sockaddr *sa2 = (const struct sockaddr*) s2;
800
801 if (sa1->sa_family != sa2->sa_family)
802 return sa1->sa_family - sa2->sa_family;
803 if (sa1->sa_family == AF_INET)
804 return memcmp(&((struct sockaddr_in *)s1)->sin_addr,
805 &((struct sockaddr_in *)s2)->sin_addr,
806 sizeof(struct in_addr));
807#ifndef NO_IPV6
808 if (sa1->sa_family == AF_INET6)
809 return memcmp(&((struct sockaddr_in6 *)s1)->sin6_addr,
810 &((struct sockaddr_in6 *)s2)->sin6_addr,
811 sizeof(struct in6_addr));
812#endif
813 return 0;
814}
815
816static unsigned int max_connections = 32;
817static unsigned int live_children;

Callers 2

add_childFunction · 0.85
kill_some_childFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected