Loading include/linux/sunrpc/msg_prot.h +13 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,19 @@ typedef __be32 rpc_fraghdr; #define RPC_MAX_HEADER_WITH_AUTH \ (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) /* * RFC1833/RFC3530 rpcbind (v3+) well-known netid's. */ #define RPCBIND_NETID_UDP "udp" #define RPCBIND_NETID_TCP "tcp" #define RPCBIND_NETID_UDP6 "udp6" #define RPCBIND_NETID_TCP6 "tcp6" /* * Note that RFC 1833 does not put any size restrictions on the * netid string, but all currently defined netid's fit in 4 bytes. */ #define RPCBIND_MAXNETIDLEN (4u) #endif /* __KERNEL__ */ #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ net/sunrpc/rpcb_clnt.c +3 −23 Original line number Diff line number Diff line Loading @@ -92,26 +92,6 @@ enum { */ #define RPCB_MAXADDRLEN (128u) /* * r_netid * * Quoting RFC 3530, section 2.2: * * For TCP over IPv4 the value of r_netid is the string "tcp". For UDP * over IPv4 the value of r_netid is the string "udp". * * ... * * For TCP over IPv6 the value of r_netid is the string "tcp6". For UDP * over IPv6 the value of r_netid is the string "udp6". */ #define RPCB_NETID_UDP "\165\144\160" /* "udp" */ #define RPCB_NETID_TCP "\164\143\160" /* "tcp" */ #define RPCB_NETID_UDP6 "\165\144\160\066" /* "udp6" */ #define RPCB_NETID_TCP6 "\164\143\160\066" /* "tcp6" */ #define RPCB_MAXNETIDLEN (4u) /* * r_owner * Loading Loading @@ -408,8 +388,8 @@ void rpcb_getport_async(struct rpc_task *task) map->r_prot = xprt->prot; map->r_port = 0; map->r_xprt = xprt_get(xprt); map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCB_NETID_TCP : RPCB_NETID_UDP; map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCBIND_NETID_TCP : RPCBIND_NETID_UDP; memcpy(map->r_addr, rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR), sizeof(map->r_addr)); Loading Loading @@ -587,7 +567,7 @@ static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p, #define RPCB_port_sz (1u) #define RPCB_boolean_sz (1u) #define RPCB_netid_sz (1+XDR_QUADLEN(RPCB_MAXNETIDLEN)) #define RPCB_netid_sz (1+XDR_QUADLEN(RPCBIND_MAXNETIDLEN)) #define RPCB_addr_sz (1+XDR_QUADLEN(RPCB_MAXADDRLEN)) #define RPCB_ownerstring_sz (1+XDR_QUADLEN(RPCB_MAXOWNERLEN)) Loading Loading
include/linux/sunrpc/msg_prot.h +13 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,19 @@ typedef __be32 rpc_fraghdr; #define RPC_MAX_HEADER_WITH_AUTH \ (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) /* * RFC1833/RFC3530 rpcbind (v3+) well-known netid's. */ #define RPCBIND_NETID_UDP "udp" #define RPCBIND_NETID_TCP "tcp" #define RPCBIND_NETID_UDP6 "udp6" #define RPCBIND_NETID_TCP6 "tcp6" /* * Note that RFC 1833 does not put any size restrictions on the * netid string, but all currently defined netid's fit in 4 bytes. */ #define RPCBIND_MAXNETIDLEN (4u) #endif /* __KERNEL__ */ #endif /* _LINUX_SUNRPC_MSGPROT_H_ */
net/sunrpc/rpcb_clnt.c +3 −23 Original line number Diff line number Diff line Loading @@ -92,26 +92,6 @@ enum { */ #define RPCB_MAXADDRLEN (128u) /* * r_netid * * Quoting RFC 3530, section 2.2: * * For TCP over IPv4 the value of r_netid is the string "tcp". For UDP * over IPv4 the value of r_netid is the string "udp". * * ... * * For TCP over IPv6 the value of r_netid is the string "tcp6". For UDP * over IPv6 the value of r_netid is the string "udp6". */ #define RPCB_NETID_UDP "\165\144\160" /* "udp" */ #define RPCB_NETID_TCP "\164\143\160" /* "tcp" */ #define RPCB_NETID_UDP6 "\165\144\160\066" /* "udp6" */ #define RPCB_NETID_TCP6 "\164\143\160\066" /* "tcp6" */ #define RPCB_MAXNETIDLEN (4u) /* * r_owner * Loading Loading @@ -408,8 +388,8 @@ void rpcb_getport_async(struct rpc_task *task) map->r_prot = xprt->prot; map->r_port = 0; map->r_xprt = xprt_get(xprt); map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCB_NETID_TCP : RPCB_NETID_UDP; map->r_netid = (xprt->prot == IPPROTO_TCP) ? RPCBIND_NETID_TCP : RPCBIND_NETID_UDP; memcpy(map->r_addr, rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR), sizeof(map->r_addr)); Loading Loading @@ -587,7 +567,7 @@ static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p, #define RPCB_port_sz (1u) #define RPCB_boolean_sz (1u) #define RPCB_netid_sz (1+XDR_QUADLEN(RPCB_MAXNETIDLEN)) #define RPCB_netid_sz (1+XDR_QUADLEN(RPCBIND_MAXNETIDLEN)) #define RPCB_addr_sz (1+XDR_QUADLEN(RPCB_MAXADDRLEN)) #define RPCB_ownerstring_sz (1+XDR_QUADLEN(RPCB_MAXOWNERLEN)) Loading