Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127442
b: refs/heads/master
c: afb0369
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Jan 6, 2009
1 parent cb36653 commit a088019
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc995801a09d1fead0bec1356bfd836911c8eed7
refs/heads/master: afb03699dc0a920aed3322ad0e6895533941fb1e
11 changes: 8 additions & 3 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ static void nlm_clear_port(struct sockaddr *sap)
}
}

static void nlm_display_ipv4_address(const struct sockaddr *sap, char *buf,
const size_t len)
{
const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
snprintf(buf, len, "%pI4", &sin->sin_addr.s_addr);
}

static void nlm_display_ipv6_address(const struct sockaddr *sap, char *buf,
const size_t len)
{
Expand All @@ -122,11 +129,9 @@ static void nlm_display_ipv6_address(const struct sockaddr *sap, char *buf,
static void nlm_display_address(const struct sockaddr *sap,
char *buf, const size_t len)
{
const struct sockaddr_in *sin = (struct sockaddr_in *)sap;

switch (sap->sa_family) {
case AF_INET:
snprintf(buf, len, "%pI4", &sin->sin_addr.s_addr);
nlm_display_ipv4_address(sap, buf, len);
break;
case AF_INET6:
nlm_display_ipv6_address(sap, buf, len);
Expand Down

0 comments on commit a088019

Please sign in to comment.