Clean up.
Defensive coding: If "family" is ever something that is neither
AF_INET nor AF_INET6, xs_reclassify_socket6() is not the appropriate
default action. Choose to do nothing in that case.
Introduced by commit
6bc9638a.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nloop++;
} while (err == -EADDRINUSE && nloop != 2);
nloop++;
} while (err == -EADDRINUSE && nloop != 2);
- if (myaddr.ss_family == PF_INET)
+ if (myaddr.ss_family == AF_INET)
dprintk("RPC: %s %pI4:%u: %s (%d)\n", __func__,
&((struct sockaddr_in *)&myaddr)->sin_addr,
port, err ? "failed" : "ok", err);
dprintk("RPC: %s %pI4:%u: %s (%d)\n", __func__,
&((struct sockaddr_in *)&myaddr)->sin_addr,
port, err ? "failed" : "ok", err);
static inline void xs_reclassify_socket(int family, struct socket *sock)
{
static inline void xs_reclassify_socket(int family, struct socket *sock)
{
+ switch (family) {
+ case AF_INET:
xs_reclassify_socket4(sock);
xs_reclassify_socket4(sock);
+ break;
+ case AF_INET6:
xs_reclassify_socket6(sock);
xs_reclassify_socket6(sock);
}
#else
static inline void xs_reclassify_socket4(struct socket *sock)
}
#else
static inline void xs_reclassify_socket4(struct socket *sock)